Printing Numbers from 1 to 10 using while loop in java

Опубликовано: 14 Август 2026
на канале: LogicLoops26
10
0

☕ Java Series – Day 22
While Loop in Java | Practical Program

Welcome to *Day 22* of the Java Series by **LogicLoops26**! 🚀

In today's video, we are starting the practical implementation of the *`while` loop* in Java.

We have already covered several practical examples using the `for` loop, so now it's time to understand how the `while` loop works with a simple program.

📚 *Topics Covered:*

✅ What is a `while` loop?
✅ How the `while` loop works
✅ Initialization of the loop variable
✅ Condition checking
✅ Increment using `i++`
✅ Printing numbers from 1 to 10
✅ Understanding how the loop terminates
✅ Avoiding infinite loops

💻 *Program Covered:*

We use a `while` loop to print numbers from **1 to 10**.

```text
1
2
3
4
5
6
7
8
9
10
```

💡 *Key Concept:*

The `while` loop first checks the condition. If the condition is **true**, the loop executes. This process continues until the condition becomes **false**.

✔️ Day 21 – Sum of Numbers Using `for` Loop
✔️ Day 22 – `while` Loop in Java (Program)

➡️ *Next Video:* Another practical example using the `while` loop.

📝 *Practice Challenge:*

Try writing a Java program using a `while` loop to print numbers from **10 to 1**.

💬 Try it yourself and share your answer in the comments!

👍 Like | 💬 Comment | 📤 Share | 🔔 Subscribe

Follow *LogicLoops26* for daily Java learning from basics to advanced.

#Java #WhileLoop #LoopsInJava #CoreJava #LearnJava #JavaTutorial #JavaProgramming #Coding #JavaForBeginners #JavaInterview #LogicLoops26