For Loop Control Statement 1 : MCQ in C Programming



For Loop Control Statement 1 :  MCQ in C Programming
Problem Statement 1 : Semicolon at the end of while

#include<stdio.h>
void main()
{
int i;
for(i=0;i<10;i++);
printf("%d ",i);
}

Options : Guess the Output

  1. 0 1 2 3 4 5 6 7 8 9
  2. Compile Error
  3. Run Time Error
  4. 9


How ?

  1. There are different Verities of “for loop” you can read more details Here
  2. For loop with ending semicolon is called Body less for loop
  3. This type of for loop is only used for incrementing subscript variable . [ Here i ]
  4. This for loop will run 10 times and finally updates value of [ i = 9 ]