Cody

Problem 45202. Check if number is a square number

Solution 2677403

Submitted on 10 Jul 2020 by Ramesh Kumar V
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(isSquare(1),true))

a = 1 y = logical 1

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

a = 2 y = logical 1

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

a = 3 y = logical 1

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

a = 7 y = logical 1

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

a = 8 y = logical 1

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

a = 123 y = logical 1

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

a = 1.7321 y = logical 0

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

a = 14.1067 y = logical 0

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!