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

 

zbaharav@kehillah.org > reduceFraction
prev  |  next  |  chance

Given two integers, a and b, representing the numerator and denominator of a fraction, respectively, return an array of three integers representing the integer part, and the fraction in its reduced form. If the fraction value is zero, it is represented as 0/1.


reduceFraction(3, 9) → [0, 1, 3]
reduceFraction(4, 3) → [1, 1, 3]
reduceFraction(12, 18) → [0, 2, 3]

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

int[] reduceFraction(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

Copyright Nick Parlante 2017 - privacy