Q: What is the output of this C code?
Options:
a) Infinite calls to main
b) Run time error
c) Varies
d) main is called twice
Answer: D
| #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