Cody

Problem 45202. Check if number is a square number

Solution 2077490

Submitted on 3 Jan 2020
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   Fail
assert(isequal(isSquare(1),true))

Assertion failed.

2   Fail
assert(isequal(isSquare(4),true))

Assertion failed.

3   Fail
assert(isequal(isSquare(9),true))

Assertion failed.

4   Fail
assert(isequal(isSquare(49),true))

Assertion failed.

5   Fail
assert(isequal(isSquare(64),true))

Assertion failed.

6   Fail
assert(isequal(isSquare(15129),true))

Assertion failed.

7   Pass
assert(isequal(isSquare(3),false))

8   Pass
assert(isequal(isSquare(199),false))

Suggested Problems

More from this Author5

Community Treasure Hunt

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

Start Hunting!