write a program using do- while loop in netbeans

 Q  write a name  five time using do- while loop


what is do - while

A do-while loop is comparable to the where as loop except that the condition is usually execute once the body of a loop. it's additionally known as associate exit-controlled loop.

The basic format of where as loop is as follows:

as we tend to saw in a very  where as loop, the body is execute if and as long as the condition is true. In some cases, we've got to execute a body of the loop a minimum of once even though the condition is false  . this sort of operation  may  be  achieved   by    employing  a   do-while loop.

In the do-while loop, the body of a loop is usually execute a minimum of once. once the body is executed , then it checks the condition. If the condition is true, then it'll once more execute the body of a loop otherwise management is transferred out of the loop.

Similar to the whereas loop, once the management  goes out of the loop the statements that square measure at once once the loop is dead.

The essential distinction between the whereas and do-while loop is that in whereas loop the whereas is written at the start. In do-while loop, the whereas condition is written at the tip and terminates with a     semi-colon (;)

program


#include <stdio.h>

#include <stdlib.h>

/*
 * 
 */
int main(int argc, char** argv) 
{
    int i=1;
    do
    {
        printf("computer education\n");
        i++;
    }while(i<=5);

    return (EXIT_SUCCESS);
}


write a program using do- while loop in netbeans


Comments

Popular posts from this blog

Create a structure TIME with members hours, minutes and seconds. Write a C program to add two time objects by passing structure variables to function and display result in H: M: S format.

Create a structure named company which has name, address, phone and no of Employee as member variables. Read name of company, its address, phone and no of Employee. Finally display these members’ value.

Write a c program to check a voting AGE condition using if-else