A very small challenging question in C....
if(condition)
printf("Hello");
else
printf("Bye");
Q: You have to Enter a Condition in if statement so that the program outputs "HelloBye" without quotes..
Answer the question by making it a comment at below the program with your correct name...
thank you
-Gaurav Singhal..
if(condition)
printf("Hello");
else
printf("Bye");
Q: You have to Enter a Condition in if statement so that the program outputs "HelloBye" without quotes..
Answer the question by making it a comment at below the program with your correct name...
thank you
-Gaurav Singhal..
This comment has been removed by the author.
ReplyDeleteif(!printf("Hello"))
ReplyDeleteprintf("Hello");
else
printf("Bye");
condition = printf("Hello") == 1
ReplyDeleteif( printf("Hello") ? 0 : 1 )
ReplyDeleteprintf("Hello");
else
printf("Bye");
if(printf("Hello")||0)
ReplyDeleteisid it will not work...as printf return 5 on execution hence the condition become true and it results in hellohello
ReplyDeleteanabik this runs but u ust also think about the efficiency of a program....
ReplyDelete