07/03/2014
A C program without semicolon
C program to display “India” without using ';' in the whole program:
For writing this program, we should first understand what printf returns and its prototype. The function declaration of printf is
int printf ( const char *, ... ) ;
It takes variable number of arguments, displays the string till a NULL character is found and returns the number of characters
printed.
Now, the program:
# include
void main()
{
if ( printf ( “India” ) )
{
}
}
The printf () returns 5 in this case. Hence, the 'if' condition is true, but, we are not doing anything even if the condition is true.