For "x is divisible by 3 OR by 5":
- A
x % 3 == 0 && x % 5 == 0
- Bcheck_circle
x % 3 == 0 || x % 5 == 0
- C
x % 15 == 0
- D
x / 3 == 0 || x / 5 == 0
Explanation
OR satisfies "either or both"; FizzBuzz pattern.
AP Computer Science A· difficulty 3/5
For "x is divisible by 3 OR by 5":
x % 3 == 0 && x % 5 == 0
x % 3 == 0 || x % 5 == 0
x % 15 == 0
x / 3 == 0 || x / 5 == 0
Explanation
OR satisfies "either or both"; FizzBuzz pattern.
Want 10 more like this — adaptive to your weak spots?