Write a program of 'do-while' loop for print the value from 1 to 10 :-


//Print 1 to 10 using 'Do-While Loop

#include<stdio.h>
#include<conio.h>
void main()
{
int x=1;

do
{
printf("%d",x);
x=x+1;
}
while(x<=10);

printf("\n");
getch();
}

Output:


12345678910

			

Previous Next