What will happen if…
 
Notifications
Clear all

What will happen if i call main() inside main() in c++ ?

1 Posts
2 Users
0 Likes
487 Views
0
Topic starter

Explain why ?

1 Answer
0

Yes, we can call the main() within the main() function.

The process of calling a function by the function itself is known as Recursion.

Well,you can call a main() within the main() function ,but you should have a condition that does not call the main() function to terminate the program.

Otherwise,the program will never return and run infinitely.

Share: