Print 1 to till you want using for loop in 'c'
Click on read more to get the full code
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("Enter the number till you want to print:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\n%d",i);
}
getch();
}
OUTPUT:
Enter the number till you want to print:10
1
2
3
4
5
6
7
8
9
10
Comments
Post a Comment