about | help | code help+videos | done | prefs |
public boolean isDivisibleBy3_OR_5(int n)
public boolean isDivisibleBy3_OR_5(int n) { boolean divBy3 = false; if (n % 3 == 0) { divBy3 = true; } boolean divBy5 = false; if (n % 5 == 0) { divBy5 = true; } boolean divBy3or5 = false; if (divBy3 || divBy5) { divBy3or5 = true; } return divBy3or5; } isDivisibleBy3_OR_5(1) → false isDivisibleBy3_OR_5(2) → false isDivisibleBy3_OR_5(3) → true ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 1
Copyright Nick Parlante 2017 - privacy