A Very Cool Unix Puzzle

by manojgumber

You have a magical program `tux.c’. When you type `cc tux.c’, your compiler appears to hang (i.e, you don’t get back the prompt). Now,during this time, you will be able to type any program `linux.c’ in the standard input and type Ctrl-D. Once you do this, you get back the prompt. Now, you type `a.out’ and magic, what you get will be the output of program `linux.c’! Question is, what is this program `tux.c’?

Source– Yahoo Interview Puzzle

Advertisements