Monday, December 27, 2010

A "Hello World" program

Why HelloWorld ??
If you will see any C/Cpp book, you will find the first program will always start with a "HelloWorld" program.. So I thought why not I also start with the same but in a different way...

This program is going to print "Hello World" but the "Hello" will be in the IF part of the conditional IF-ELSE  and "World" will be in the ELSE part..
Interesting na ?

#include<stdio.h>
void main()
{
    if(!printf("Hello"))
      {}
    else
      {
      printf("World");
      }
}

No comments:

Post a Comment