C PROGRAM |
C program to print values from 1 to n - infintynotes00
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i;
clrscr();
printf("Enter n \n");
scanf("%d",&n);
for(i=1; i<=n; i++)
{
printf("\n%d\n",i);
}
getch();
}
OUTPUT:
Enter n
5
1
2
3
4
5
[Process completed (code 10) - press Enter
No comments:
Post a Comment