about | help | code help+videos | done | prefs |
sumMultiples
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy