The do..while loop is similar to the while loop with one important difference. The body of do...while loop is executed at least once. Only then, the test expression is evaluated.
//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(); }
12345678910
Copy Program