Skip to main content

Write a program to print n term natural number using do while loop


//Write a program to print n term natural number using do while loop
#include<stdio.h>
#include<conio.h>
void main()
{ int x=1,n;
clrscr();
printf("Enter any term of number:\n");
scanf("%d",&n);
do
{
 printf("%d",x);
 x++;
}
while(x<=n);//Print the number then check the condition 
getch();
}

Comments