id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

srp4379@lausd.net 1-logicbasics > divideBy5remainderIs1
prev  |  next  |  chance

public boolean divideBy5remainderIs1(int n)

Given a number (int), return true if it, when you divide it by 5,
the remainder is 1. False otherwise.


  boolean rem1 = false; // default
  if (n % 5 == 1) {
    rem1 = true;
  }
  return rem1;

divideBy5remainderIs1(5) → false
divideBy5remainderIs1(6) → true
divideBy5remainderIs1(11) → true

...Save, Compile, Run (ctrl-enter)

public boolean divideBy5remainderIs1(int n) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 1

Copyright Nick Parlante 2017 - privacy