about | help | code help+videos | done | prefs |
public boolean isDivisibleBy3_AND_5(int n)
public boolean isDivisibleBy3_AND_5(int n) { boolean divBy3 = false; if (n % 3 == 0) { divBy3 = true; } boolean divBy5 = false; if (n % 5 == 0) { divBy5 = true; } boolean divBy3and5 = false; if (divBy3 && divBy5) { divBy3and5 = true; } return divBy3and5; } isDivisibleBy3_AND_5(9) → false isDivisibleBy3_AND_5(15) → true isDivisibleBy3_AND_5(25) → false ...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