Follow Me on Twitter

Friday, October 30, 2009

Solutions to C Puzzles 5

What's the  "condition" so that the following code
snippet prints both HelloWorld !

if "condition"
printf ("Hello");
else
printf("World");

Solution:


#include
int main()
{
int x=0;
if (5<(printf ("Hello")))
{
printf ("Hello");
else
printf("World");
}
}

No comments:

Post a Comment