# 🚀 Day 25 of My Automation Journey – Deep Dive into Logic 🔁 (Part 2)
Continuing from earlier, here are the remaining core number programs with full step-by-step explanations to strengthen logic building 👇 🔹 6. Divisors of a Number – Correct Logic 💻 Program: int u...

Source: DEV Community
Continuing from earlier, here are the remaining core number programs with full step-by-step explanations to strengthen logic building 👇 🔹 6. Divisors of a Number – Correct Logic 💻 Program: int user = 15; for(int i = 1; i <= user; i++) { if(user % i == 0) System.out.println(i); } 🧠 Logic Explained: user % i == 0 means: 👉 “Can i divide user without remainder?” Loop runs from 1 → 15 🔍 Step-by-Step Trace: i 15 % i Result 1 0 ✅ Print 2 1 ❌ 3 0 ✅ 4 3 ❌ 5 0 ✅ 15 0 ✅ 📤 Output: 1 3 5 15 💡 Key Insight: 👉 Divisors are numbers that perfectly divide the given number 🔹 7. Count of Divisors 💻 Program: int user = 15; int count = 0; for(int i = 1; i <= user; i++) { if(user % i == 0) count++; } System.out.println(count); 🧠 Logic Explained: Same logic as divisors Instead of printing → we count 🔍 Example: Divisors of 15 → 1, 3, 5, 15 👉 Count = 4 📤 Output: 4 💡 Key Insight: 👉 Reuse logic + add counter → powerful pattern 🔹 8. Count of Digits 💻 Program: int user = 12345; int count = 0