C Program To Print Hello World Without Using Semicolon

In this post, we will learn how to print hello world without using semicolon in C Programming language.

C Program To Print Hello World Without Using Semicolon

There are various approaches to writing this program. Some of them are as follows: 

  1. Using If Statement
  2. Using While Statement
  3. Using If-else Statement
  4. Using Switch Case

So, without further ado, let’s begin this tutorial.

C Program To Print Hello World Without Using Semicolon Using If Statement

// C Program To Print Hello World Without Using Semicolon
#include <stdio.h>
int main(){
    if (printf("Hello, World")){
    }
    return 0;
}

Output

Hello, World

C Program To Print Hello World Without Using Semicolon Using While Statement

// C Program To Print Hello World Without Using Semicolon
#include <stdio.h>
int main(){
    while(printf("Hello, World!")){
        break;
    }
    return 0;
}

Output

Hello, World!

C Program To Print Hello World Without Using Semicolon Using If-else Statement

// C Program To Print Hello World Without Using Semicolon
#include <stdio.h>
int main(){
    if(0){
    }
    else if (printf("Hello, World!")){
    }
    return 0;
}

Output

Hello, World!

C Program To Print Hello World Without Using Semicolon Using Switch case

// C Program To Print Hello World Without Using Semicolon
#include <stdio.h>
int main(){
    switch(printf("Hello, World!")){
    }
    return 0;
}

Output

Hello, World!

Conclusion

I hope after going through this post, you understand how to print hello world without using a semicolon in C Programming language.

If you have any doubt regarding the program, feel free to contact us in the comment section. We will be delighted to help you.

Also Read:

Leave a Comment

Your email address will not be published. Required fields are marked *