This statement is also a conditional branching process. It is used exactly like while statement. The main difference is that in the while statement, the condition is checked first and the block is executed only after the condition is met, but in the do statement, the block is executed first and then the condition is checked. If the condition is met then the block is executed for the second time. This process continues as long as the condition is not met.
Special - The block written in the do statement must be executed at least once. Whereas in other looping statement, the execution of the block depends on the fulfillment of the condition.
Formula of do statement-
do
}
Block of Instruction
}
while(condition);
In this also {} braces are used to write more than one statement inside the loop.
рдпрд╣ рд╕्рдЯेрдЯрдоेрди्рдЯ рднी рд╕рд╢рд░्рдд рдм्рд░ाрди्рдЪिрдЧ рдк्рд░рдХ्рд░िрдпा рд╣ै। рдЗрд╕े рдмिрд▓्рдХुрд▓ while рд╕्рдЯेрдЯрдоेрди्рдЯ рдХी рднाँрддि рдк्рд░рдпोрдЧ рдХिрдпा рдЬाрддा рд╣ै। рдЗрд╕рдоें рдоुрдЦ्рдп рдЕрди्рддрд░ рд╣ै рдХि while рд╕्рдЯेрдЯрдоेрди्рдЯ рдоें рд╢рд░्рдд рдкрд╣рд▓े рдЪैрдХ рд╣ोрддी рд╣ै рдФрд░ рд╢рд░्рдд рдХे рдкूрд░्рдг рд╣ोрдиे рдкрд░ рд╣ी block execute рд╣ोрддा рд╣ै рд▓ेрдХिрди do рд╕्рдЯेрдЯрдоेрди्рдЯ рдоें рдк्рд░рдердо рдж्рд╡ाрд░ block execute рд╣ो рдЬाрддा рд╣ै рдлिрд░ рд╢рд░्рдд рдХो рдЪैрдХ рдХिрдпा рдЬाрддा рд╣ै। рдпрджि рд╢рд░्рдд рдкूрд░्рдг рд╣ोрддी рд╣ै рддो block рджूрд╕рд░ी рдмाрд░ execute рд╣ो рдЬाрддा рд╣ै। рдпрд╣ рдк्рд░рдХ्рд░िрдпा рдЬрдм рддрдХ рдЪрд▓рддी рд░рд╣рддी рд╣ै, рдЬрдм рддрдХ рд╢рд░्рдд рдЕрдкूрд░्рдг рдирд╣ीं рд╣ोрддी।
Read more:
рд╡िрд╢ेрд╖- do рд╕्рдЯेрдЯрдоेрди्рдЯ рдоें рд▓िрдЦा рдЧрдпा block рдХрдо рд╕े рдХрдо рдПрдХ рдмाрд░ execute рдЕрд╡рд╢्рдп рд╣ोрддा рд╣ै। рдЬрдмрдХि рдЕрди्рдп рд▓ूрдкिंрдЧ рд╕्рдЯेрдЯрдоेрди्рдЯ рдоें block рдХा execute рд╣ोрдиा рд╢рд░्рдд рдХे рдкूрд░्рдг рд╣ोрдиे рдкрд░ рдиिрд░्рднрд░ рдХрд░рддा рд╣ै।
do рд╕्рдЯेрдЯрдоेрди्рдЯ рдХा рд╕ूрдд्рд░-
do
}
Block of Instruction
}
while (condition);
рдЗрд╕рдоे рднी рдПрдХ рд╕े рдЬ्рдпाрджा рд╕्рдЯेрдЯрдоेрди्рдЯ рдХो рд▓ूрдк рдХे рдЕрди्рджрд░ рд▓िрдЦрдиे рдХे рд▓िрдП {} braces рдХा рдк्рд░рдпोрдЧ рдХिрдпा рдЬाрддा рд╣ै।

