Multiple choice technology programming languages

mainn() { main(); } This loop runs upto???

  1. Infinite loop

  2. Until Stack Underflow

  3. Until Machine Hangs

  4. Stack Overflow

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

This code creates infinite recursion by calling main() from within mainn(), which in turn calls main() again. Each call adds a new stack frame without ever returning, eventually consuming all available stack space and causing stack overflow. The loop continues until the stack memory is exhausted, not underflow or machine hang.