C Programming :: Basic Concepts
3. What is the output of the following C Program?
main function calls itself again and again. Each time the function is called its return address is stored in the call stack.
Since there is no condition to terminate the function call, the call stack overflows at runtime. So it terminates the program and results in an error.
19 Apr, 2019 1:56 AM
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.
Please Login First Click Here