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

 

norm.krumpe@muohio.edu looppractice > gcf
prev  |  next  |  chance

The greatest common factor (gcf) of ints a and b is the largest positive int that divides both a and b without leaving a remainder. For example, the gcf of 12 and 20 is 4. The gcf of 16 and 25 is 1. Given ints a and b (assume positive values for both), return the gcf of the numbers.


gcf(12, 20) → 4
gcf(1, 100) → 1
gcf(100, 200) → 100

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

int gcf(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: 200

Copyright Nick Parlante 2017 - privacy