A Developer's Diary

Feb 23, 2008

Print Hello, World without using semicolon

Not used practically, but asked very frequently by the interviewers.

#include <stdio.h>

int main(){
if(printf("Hello, World\n")){}
while(!printf("Hello, World\n")){}
switch(printf("Hello, World\n")){}
return 0;
}

No comments :

Post a Comment