C Programming Reference >> C Programming Reference Question Bank >>
19/07/07 - 714 Views - Ratings :    3.8 of 5 / 5 Votes
Level - Beginner
Question -
Write a program to print "HI", without any semi colon.
Answer -
#include <stdio.h>
void main ()
{
if ( printf ("HI"))
}
Explanation -
Tricky C question and favorite of examiners. Quite self explanatory and easy to grasp code. One point to mention is that we can not use int main () because then we need a semi colon in return statement.
Reader Comments -
| Suresh
|
i run this above program but i got one error it say's functional statement " ; "missing how do i rectify that...
|
| tirtocan
|
The question is excellent, however, the solution does not work. Alternatively:
#include
int main(){ while(printf("alon")-4) {} }
|
| tirtocan
|
Sorry, the correct one:
#include
int main(){ while(printf("HI")-2) {} }
|
|