How many times the program will print "ExamsNepal" ?

13 views
  • Infinite times (Correct Answer)
  • 32767 times
  • 65535 times
  • Till stack overflows

Explanation

The program will print "ExamsNepal" infinite times.

The main() function of the program calls itself recursively, without any base case or stopping condition. This means that each time main() is called, a new call to main() is made, which in turn calls main() again, and so on. This creates an infinite loop, causing "ExamsNepal" to be printed repeatedly without end.

The only way to stop the program is to manually interrupt it or cause a stack overflow by exceeding the maximum allowed recursion depth.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs