Write a C program to print 1 to 10 numbers using the while loop
Description:
You need to create a C program to print 1 to 10 numbers using the while loop
Conditions:
- Create a variable for the loop iteration
- Use increment operator in while loop
#include<stdio.h>
int main()
{
int x=1;
while(x<=10)
{
printf("%d\n",x);
x++;
}
return 0;
}
Tutorials Class - Output Window
1
2
3
4
5
6
7
8
9
10
Learn more about the similar topics:
Tutorials |
---|
No Content Found. |
Exercises & Assignments |
---|
No Content Found. |
Interview Questions & Answers |
---|
No Content Found. |