Multiple choice

The output of the following code snippet is ___________ ( ) Unsigned int icount=1; While(icount<10); { Printf(%u,icount); }

  1. 1,2,_ _ _ 10

  2. an infinite loop

  3. 1,2,3 _ _ _ 9

  4. error in code

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

The while loop condition is followed by a semicolon, creating an empty loop body. Since icount is initialized to 1 and never incremented within the loop, the condition (icount < 10) remains true forever. The program enters an infinite loop and never reaches the printf statement.