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..
7 comments:
if(!printf("Hello"))
printf("Hello");
else
printf("Bye");
condition = printf("Hello") == 1
if( printf("Hello") ? 0 : 1 )
printf("Hello");
else
printf("Bye");
if(printf("Hello")||0)
isid it will not work...as printf return 5 on execution hence the condition become true and it results in hellohello
anabik this runs but u ust also think about the efficiency of a program....
Post a Comment