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

 

srp4379@lausd.net quiz3 > bothEvenOrBothDifferent
prev  |  next  |  chance

public boolean bothEvenOrBothDifferent(int a, int b).
Given two integers, return true
(A) if both of them are even or
(B) if one is even and the other is odd.

Return false if both numbers are odd.

A number is EVEN if, when you divide it by 2, its remainder is zero, e.g. num % 2 == 0.
A number is ODD if, when you divide it by 2, its remainder is NOT zero, e.g. num % 2 != 0.


bothEvenOrBothDifferent(1, 3) → false
bothEvenOrBothDifferent(2, 6) → true
bothEvenOrBothDifferent(1, 4) → true

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

public boolean bothEvenOrBothDifferent(int a, int b) { }

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: 105

Copyright Nick Parlante 2017 - privacy