π Day 25 of My Automation Journey β Prime Numbers, Reverse Logic & Loops
java
dev.to
Today, instead of just writing programs, I focused on understanding the βWHYβ behind each logic. Letβs break everything down step by step π πΉ 1. Divisors Logic β Step-by-Step Understanding π» Program: int user = 15; int i = 0; while (i user) { if (i % user == 0) System.out.println(i); i++; } π§ Logic Explained: i % user == 0 means: π βIs i divisible by user?β Loop runs from 0 β 15 Letβs trace: i value i % 15 Condition 0 0