Program:
#include<stdio.h>
#include<conio.h>
void main( )
{
int c=1,n;
printf("\n Enter N value: ");
scanf("%d", &n);
while(c<=n)
{
printf("\n %d",c);
c++;
}
getch( );
}
Input/Output:
Enter N value: 5
1
2
3
4
5
#include<stdio.h>
#include<conio.h>
void main( )
{
int c=1,n;
printf("\n Enter N value: ");
scanf("%d", &n);
while(c<=n)
{
printf("\n %d",c);
c++;
}
getch( );
}
Input/Output:
Enter N value: 5
1
2
3
4
5
0 comments:
Post a Comment