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

Java > Logic-1 > lastDigit
prev  |  next  |  chance

Given three ints, a b c, return true if two or more of them have the same rightmost digit. The ints are non-negative. Note: the % "mod" operator computes the remainder, e.g. 17 % 10 is 7.

lastDigit(23, 19, 13) → true
lastDigit(23, 19, 12) → false
lastDigit(23, 19, 3) → true

...Save, Compile, Run

See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  CodingBat  >  Logic-1

Forget It! -- delete my code for this problem

New just for fun
 Random User Progress Graphs
 Random Epic Graphs 145.0

Copyright Nick Parlante 2006-11 - privacy