Cody

Problem 46093. GCD

Solution 2770678

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(gc_cal(100,30),10))

2   Pass
assert(isequal(gc_cal(1,1),1))

3   Pass
assert(isequal(gc_cal(28851538, 1183019), 17657))

4   Pass
assert(isequal(gc_cal(482372133,334748212),53))

5   Pass
assert(isequal(gc_cal(777,23),1))

6   Pass
assert(isequal(gc_cal(60,260),20))

7   Pass
filetext = fileread('gc_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!