C Programming :: Basic Concepts - Discussion
Home > C Programming > Basic Concepts > MCQs Questions Discussion
3 / 90
What is the output of the following C Program?
#include<stdio.h>
void main()
{
main();
}
#include<stdio.h>
void main()
{
main();
}
ACompiler error
BStack overflow.
CNone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
In the above code, the main() function gets called again and again, and for each call it's entry gets stored in the stack register. Since, there is no condition to terminate the function call, at runtime, the stack register gets overflowed , and we get an error at runtime.
So, the correct option is B.
Read Full Answer
Report Error
Please Login First Click Here