Introduction
The do-while loop is used when you want to execute the loop body at least once. The do-while loop executes the loop body and then traces the condition.
Program/Example
The general format for a do-while loop is
do simple or compound statement while (condition) For example, i = 0; do { printf(" the value of i is %d\n", i); i = i + 1; } while (i<5)>
No comments:
Post a Comment