Skip to main content

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.

Back to lesson: Practice: Evaluate everything