Complete the following program and find the output?
main()
{int a;
for(a = O; a<10;a++)
};
Answers
Answered by
0
The loop runs for 1 to 10. Because for i = 11, the condition i < 11 does not satisfy
Explanation:
- This is the C program using for loop.
- We can print the numbers from 1 to 10 using for loop.
#include <stdio.h>
#include <conio.h>
int main()
{
int i;
clrscr():
for (i = 1; i < 11; i++)
{
printf("\n%d ", i);
}
getch();
}
- When we execute this program, the output will be:
1
2
3
4
5
6
7
8
9
10
The loop runs for 1 to 10. Because for i = 11, the condition i < 11 does not satisfy
Similar questions