C - Functions - Discussion

You Are Here :: Home > C > Functions - Discussion

 



Q.

main()
{
main();
}

A. 1 B. 0
C. Compiletime error D. Runtime error

Answer: Option D
Explaination:

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.



Discussion

Your Comments Goes here...
NameDiscussion