Wednesday, 10 December 2014

Programming Quiz-5

Q: What is the output of this C code?

#include <stdio.h>

void main()

{

    static int x;

    if (x++ < 2)

    main();

}

 Options:

a) Infinite calls to main
b) Run time error
c) Varies
d) main is called twice

Answer: D

No comments:

Post a Comment