Cody

Problem 42321. given number is power of n or not?

Solution 672561

Submitted on 20 May 2015 by Andrew Stamps
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
%% x = 16; n=2 y_correct = 'true'; assert(isequal(Powerof(x,n),y_correct))

n = 2

2   Pass
%% x = 14; n=2 y_correct = 'false'; assert(isequal(Powerof(x,n),y_correct))

n = 2

3   Pass
%% x = 64; n=4 y_correct = 'true'; assert(isequal(Powerof(x,n),y_correct))

n = 4

4   Pass
%% x = 625; n=5 y_correct = 'true'; assert(isequal(Powerof(x,n),y_correct))

n = 5

5   Pass
%% x = 15; n=5 y_correct = 'false'; assert(isequal(Powerof(x,n),y_correct))

n = 5

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!