What will happen when the below code snippet is executed?
void my_recursive_function()
{
my_recursive_function();
}
int main()
{
my_recursive_function();
return 0;
}
void my_recursive_function()
{
my_recursive_function();
}
int main()
{
my_recursive_function();
return 0;
}
A. The code will be executed successfully and no output will be generated
B. The code will be executed successfully and random output will be generated
C. The code will show a compile time error
D. The code will run for some time and stop when the stack overflows
Answer: Option D
Join The Discussion