Discussion :: Functions
-
Which of the following statements are correct about the program?
#include
int main() { printf("%p\n", main()); return 0; }
A.
It prints garbage values infinitely |
B.
Runs infinitely without printing anything |
C.
Error: main() cannot be called inside printf() |
D.
No Error and print nothing |
Answer : Option B
Explanation :
In printf("%p\n", main()); it calls the main() function and then it repeats infinetly, untill stack overflow.
Be The First To Comment