Cody

Problem 46096. LCM

Solution 2770762

Submitted on 3 Aug 2020 by Asif Newaz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(lc_cal(5,6),30))

y = 30

2   Pass
assert(isequal(lc_cal(65,24843),124215))

y = 124215

3   Pass
assert(isequal(lc_cal(28851538,1183019),1933053046))

y = 1.9331e+09

4   Pass
assert(isequal(lc_cal(3,9),9))

y = 9

5   Pass
assert(isequal(lc_cal(1,1),1))

y = 1

6   Pass
assert(isequal(lc_cal(6236412, 24228),12591315828))

y = 1.2591e+10

7   Pass
filetext = fileread('lc_cal.m'); assert(isempty(strfind(filetext, 'gcd')),'gcd() forbidden') assert(isempty(strfind(filetext, 'lcm')),'lcm() forbidden')

Suggested Problems

More from this Author149

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!