Practice · 3 of 4
Remainder check
CHALLENGE
Difficulty: beginner+25 XP
Implement boolean dividesEvenly(int a, int b): true when b divides a with no remainder. Careful with b == 0: division by zero never happens because && short-circuits — return false when b is 0.
Press Submit to check your solution.
Back to lesson: Practice: Evaluate everything