do – while loop

The do – while loop statement allows you to execute code block in loop body atleast one time.

The syntax is:-


statement 1;
statement 2;
statement 3;
statement n;

}while ( condition );

Example C program.

int main()

int  count = 0;


/* Welcome to is printed at least  one time
even though the while loop condition is false*/
printf(“Welcome to\n”);

}while (count != 0);

return 0;



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.