int main() {
if (/*your code goes here*/) {
printf("hello");
} else {
printf("world");
}
return 0;
}
Try printing "helloworld" by just filling in the condition in the if statement ?
Hint:
Ever wondered what printf returns? ;)
int main() {
if (/*your code goes here*/) {
printf("hello");
} else {
printf("world");
}
return 0;
}
if (printf("hello") == 99) {
ReplyDeleteprintf("hello");
} else {
printf("world");
}
------------------------------------------------
Heres a crazy one
------------------------------------------------
int *ptr;
if (printf("helloworld") == 10? *ptr==10 :false) {
printf("hello");
} else {
printf("world");
}
lol. you do know that ptr would be initialized to junk.
ReplyDeleteI'm not sure y u're doing what you're doing.
Anyways, you'd end up printing either helloworldhello or helloworldworld :) [without the smiley of course.