Cody

Problem 45363. Exponentiation

Solution 2161075

Submitted on 15 Mar 2020 by Tim
  • Size: 23
  • This is the leading solution.
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(mod_expo(5,3,13),8))

2   Pass
assert(isequal(mod_expo(10,4,11),1))

3   Pass
assert(isequal(mod_expo(4,13,497),445))

4   Pass
assert(isequal(mod_expo(4,311,497),464))

5   Pass
assert(isequal(mod_expo(50,300,13),1))

6   Pass
assert(isequal(mod_expo(1000,300,23),3))

7   Pass
assert(isequal(mod_expo(64,43,4),0))

8   Pass
assert(isequal(mod_expo(644,43,5),4))

9   Pass
assert(isequal(mod_expo(327,211,56),47))

10   Pass
assert(isequal(mod_expo(3277,211,234),1))

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!