Multiple choice technology programming languages

The code below will go into infinite loop: #include #include #include main() { int i=0, j=0; clrscr(); for (i=0; i<5;i++) { for (j=i; j<=0; j--) { printf ("1\t"); } printf("\n"); } getch(); return (0); }

  1. True

  2. False

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

The inner loop condition j=i; j&lt;=0; j-- is problematic. When i=0, j starts at 0, condition is true, j becomes -1, condition fails immediately. When i=1 or higher, j starts >=1, condition j<=0 is false immediately, so the inner loop never executes. The code runs and terminates normally - it does NOT enter an infinite loop. The claimed answer is correct.