Thursday , November 21 2019

C #10 – Do-While Loop in C Language

Do-While Loop

Unlike for and while loops, which test the loop condition at the top of the loop, the do…while loop in C programming checks its condition at the bottom of the loop.

A do…while loop is similar to a while loop, except the fact that it is guaranteed to execute at least one time.

Syntax

The syntax of a do…while loop in C programming language is:

do {

   statement(s);

} while( condition );
// File name P10.C
void main()
{
    int i = 0;
    clrscr();
    do{
    printf("The Value Is %d\n",i);
    i++;
    }
    while(i==10);
    getch();

}

About Faheem

Faheem
An adaptable and responsible Software Engineer, who enjoys working with computers and the opportunity to learn new skills and work with new technologies is particularly attractive to me.

Check Also

C #07 – Operators in C Language

Operators in C Language An operator is a symbol that tells the compiler to perform …

Leave a Reply

Your email address will not be published.