Hello World

Hello world is the first program that everyone write. Here is the program in C:

#include <stdio.h>

int main()
{
   printf("Hello World");
   return 0;
}

We can write the above program without using any semicolon (;). There are three ways to do that.

#1. Using While Loop:

#include <stdio.h>

void main()
{
    while(printf("Hello World")){
    }
}

#2. Using Conditional Logic

#include <stdio.h>

void main()
{
    if(printf("Hello World")){
    }
}

#3. Using Switch:

#include <stdio.h>

void main()
{
    switch(printf("Hello World")){
    }
}
Newer Post
Previous
This is the last post.

0 comments :

Post a Comment

Spam comments will be deleted. :)

 
Loading...
TOP