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
- 0 1 2 3 4 5 6 7 8 9
- Compile Error
- Run Time Error
- 9
How ?
- There are different Verities of “for loop” you can read more details Here
- For loop with ending semicolon is called Body less for loop
- This type of for loop is only used for incrementing subscript variable . [ Here i ]
- This for loop will run 10 times and finally updates value of [ i = 9 ]