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

 

norm.krumpe@muohio.edu > lcm
prev  |  next  |  chance

The multiples of 1 are 1, 2, 3, 4, and so on. The multiples of 6 are 6, 12, 18, 24, and so on. The multiples of 4 are 4, 8, 12, 16, and so on. The common multiples of 6 and 4 are 12, 24, 36, 48, and so on. The "least common multiple" of 6 and 4 is 12. Given two positive integers, find their least common multiple.


lcm(6, 4) → 12
lcm(4, 1) → 4
lcm(4, 4) → 4

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

int lcm(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: 100

Copyright Nick Parlante 2017 - privacy