pramode_ce (pramode_ce) wrote,
pramode_ce
pramode_ce

C Puzzle

Here is a C puzzle I got from Bestin:

You have a magical program `a.c'. When you type `cc a.c', your compiler appears to hang (ie, you don't get back the prompt). Now,during this time, you will be able to type any program `b.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 `b.c'! Question is, what is this program `a.c'?

Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 12 comments