Tuesday, December 20, 2005

solve this

if(X)
{
printf("Hello");
}
else
{
printf("World");
}

Question: What should be the value of "X" so that the output is HelloWorld?

1 comment:

Anonymous said...

This is simple,
Look the below example,

main()
{
clrscr();
if( printf( "Hello") == 0 )
{
printf( "Hello" );
}
else
{
printf("world");
}
getch( );
}

This is Because printf() will return number of bytes output if success.