🔄 Java Loops

Loops let you repeat actions until a condition is met or iterate over a range of values.

🖥️ Example 1: for Loop

The for loop is used when the number of iterations is known.

Output will appear here...

🖥️ Example 2: while Loop

Executes a block of code as long as the specified condition is true.

Output will appear here...

🖥️ Example 3: do-while Loop

The do-while loop runs the code block at least once, then checks the condition.

Output will appear here...
💡 Tip: Always ensure your loops have a termination condition to avoid infinite loops.