Skip to content
Home » Using Macros C Program to Print Hello World without Using a Semicolon

Using Macros C Program to Print Hello World without Using a Semicolon

Learn about Using Macros C Program to Print Hello World without Using a Semicolon in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

Macros can also be used to display the string “Hello World” on the screen without the usage of a semicolon. We must create a macro with printf or puts and apply it within conditional sentences.

Using Macros C Program to Print Hello World without Using a Semicolon

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

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 to Print Hello World Without Using Semicolon(printf and switch conditional statement)
C Program to Print Hello World Without Using Semicolon( printf and while conditional statement)