A few weeks ago, a friend approached me with a set of google interview questions. There was one that i found particularly interesting, and really creative.
if(condition) {
printf("hello");
}
else {
printf("world");
}
What condition prints "helloworld"?
i'll post the solution tomorrow.
3 comments:
#define condition (printf("hello"),0)
if((printf("HELLO"))==0)
{
printf("");
}
else{
printf("WORLD");
}
if( printf("hello") != printf("") )
is the condition
Post a Comment