Skip to content
Home » C Program to Print Hello World Without Using Semicolon ( printf and if conditional statement)

C Program to Print Hello World Without Using Semicolon ( printf and if conditional statement)

Learn about C Program to Print Hello World Without Using Semicolon ( printf and if conditional statement) in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

We can use printf and the if statement to create a C program that prints hello world without needing a semicolon. If the condition is met, the printf function displays the string “Hello World” and returns the number of characters in the string. However, because our task has been performed, we may close the if statement with{}.

C Program to Print Hello World Without Using Semicolon ( printf and if conditional statement)

#include<stdio.h>
int main()
{
  if(printf("Hello World")){}
  return 0;
}

Output:

Hello World

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Codes :
C Program Without Main() Function
C Program Without Main() Function using Macro and Token-pasting Operator (##)