Do While Loop

Do-While is different from while in the way that it will execute the body of while before checking the condition.




Read Me

do while loop executes at least one time




Syntax for 'Do While Loop'


do {

    ..

    ...

   } while( condition check  );

                              




C Example


#include<stdio.h>

int main() {

	int i=1;

	do {

		printf("\n now at floor %d",i);

		i++;

	}

	while(i< 1);

	printf("\n out of while");

	return 0;

}