Difference between while & do while loops in C
C Loop control statement Loop control statements in C are used to perform looping operations until the given condition is true. Control comes out of the loop statements once condition becomes false. Types of loop control statements in C: There are 3 types of loop control statements in C language. They are, for while do-while Example program (For Loop) in C: #include <stdio.h> int main() { int i; for(i=0;i<10;i++) { printf("%d ",i); } } 1 2 3 4 5 6 7 8 9 10 11 12 #include <stdio.h> int main ( ) { int i ; for ( i = 0 ; i < 10 ; i ++ ) { printf ( "%d " , i ) ; } } Output: 0 1 2 3 4 5 6 7 8 9 Example program (while loop) in C: In while loop control statement, loop is executed until condition becomes false . #include <stdio.h> int main() {