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

 

norm.krumpe@muohio.edu program9 > sumMultiples
prev  |  next  |  chance

Find the sum of all multiples of int m that are less than or equal to int n. Assume that m and n are positive. For example, sumMultiples(3, 10) returns 18 because the multiples of 3 that are less than or equal to 10 are 3, 6, and 9, and 3 + 6 + 9 = 18.


sumMultiples(3, 10) → 18
sumMultiples(10, 20) → 30
sumMultiples(10, 9) → 0

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

public int sumMultiples(int m, int n) { }

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