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>
Comments
Post a Comment