How to use the do-while loop statement?
There is also a
do-loop in the Java programming language. Instead of evaluating the expression at the beginning like the
while loop does the
do-while loop evaluates its expression at the end of the loop. Due to this the loop executes at least once during the program execution.
The program prints the following result: