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

 

jebbert@volusia.k12.fl.us > test2022_05_16_APSL_relativelyPrime
prev  |  next  |  chance

Two integers are relatively prime (or coprime) if there is no integer greater than one that divides them both (that is, their greatest common divisor is one). For example, 12 and 13 are relatively prime, but 12 and 14 are not, because they are both divisible by 2. As preconditions, you may assume that 'a' and 'b' are both positive integers greater than 1. You may NOT assume that a<b or that b<a.


test2022_05_16_APSL_relativelyPrime(2000, 1707) → true
test2022_05_16_APSL_relativelyPrime(51, 51) → false
test2022_05_16_APSL_relativelyPrime(9, 15) → false

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

public boolean test2022_05_16_APSL_relativelyPrime(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: 290

Copyright Nick Parlante 2017 - privacy