Problem Statement
In this program we will code a basic program to print numbers counting from 1 to 100 using C-Programming language.
We can do this with the help of
- Looping concept
- Predefined C function – printf()
Code
#include<stdio.h>
int main()
{
int i;
for(i=1; i<=100; i++)
{
print("%d ",i);
}
return 0;
}
Output
1 2..99 100
Explanation
To print the counting from 1 to 100, all we need is to loop our counter variable i from 1 to 100. We do this by starting it by i = 1 and in each iteration we increment it by 1.