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

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

The number 6 is a truly great number. Given two int values, a and b, return true if either one is 6. Or if their sum or difference is 6. Note: the function Math.abs(num) computes the absolute value of a number.

love6(6, 4) → true
love6(4, 5) → false
love6(1, 5) → 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 120

Copyright Nick Parlante 2006-10 - privacy