What is while Loop?
As long as the (while
) statement’s condition evaluates to true, the (while
) assertion cycles around a block of code. They’re used to run a section of code repeatedly until the set condition is met. The while loop keeps repeating an action until an associated condition returns false.
Syntex:-
while (condition is true) {
code to be executed;
}
Example1:-
Output:-
Example2:-
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