Multiple choice technology programming languages

What is the output ?main(){ int i; for(i=0;i<10;i++); printf("%d", i); }

  1. 10

  2. 11

  3. Compilation error-Null can not be there after for

  4. Infinite loop

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

The for loop has a semicolon immediately after its closing parenthesis, making it an empty loop body. The loop executes from i=0 to i=9, then when i becomes 10, the condition i<10 becomes false and the loop exits. The printf then prints 10, the final value of i.