How to print “Hello World” without using semicolon in C Programs?

Before going to write C program for this problem, I would like to give some of the possibilities to solve this kind of problem.

  1. using If-statement
  2. Using switch statement
  3. using loops etc …
/* First method, using if statement */

#include<stdio.h>
void main ()
{
  if ( printf ( "Hello World\n" ))
  {
}
}

/* Second method, using while loop */

#include<stdio.h>
void main ()
{
  while ( !(printf ( "Hello World\n" )))
  {
}
}
/* Third method, using switch statement */
#include<stdio.h>
void main ()
{
  switch ( printf ( "Hello World\n "))
  {
}
}

Now, we can say that like “Hello World” , we can print anything in C without using semicolon. I hope, it would be helpful for you.

To contribute :

If you like Advance Computing and would like to contribute, you can  mail your article to “computingadvance@gmail.com”. You will get credit as your name , email id, designation with article on this blog.

Leave a Reply

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