Total Pageviews

print numbers 1 to n using while loop


Program to print numbers from 1 to n using while loop.

#include
#include
void main()
{
int i=1, n;
clrscr();
printf("Enter n : ");
scanf("%d", &n);
while(i<=n)
{
printf("%d\t",i);
i++;
}
getch();
}
@

No comments:

Post a Comment

Thank you