What is Do….While Loops?
The (do-while
loop) is a version of the while loop in which the state is assessed at the end of each loop iteration. A (while
loop) runs a block of code once and then evaluates the condition; if the condition is true, the expression is repeated as long as the condition is true.
Syntax:-
do {
code to be executed;
} while (condition is true);
Example:-
Output:-
Latest posts by Ashwani Kumar (see all)
- Top 10 DevOps Trainers in the world - October 7, 2023
- What is Cookies and Why it is Used? - May 24, 2023
- TOP trends of transitions in TikTok - May 10, 2023