Problem 44683. Perfect Square
Determine if the input is a perfect square (square of an integer) or not.
Example -
If input is 25(==5^2), return 1.
If input is 17, return 0.
Use of if-else and switch is prohibited to prevent hard coded solutions.
Solution Stats
Problem Comments
-
2 Comments
Lincoln Poon
on 20 Jan 2021
FYI, switch-case works just like if-else.
Please prevent that as well if you hate hard-coded solutions.
Dyuman Joshi
on 30 Jan 2021
@Lincoln Thank you for the note.
I will do so as well.
Solution Comments
Show commentsProblem Recent Solvers79
Suggested Problems
-
1882 Solvers
-
Create a square matrix of multiples
471 Solvers
-
Duplicate each element of a vector.
603 Solvers
-
Create a vector whose elements depend on the previous element
655 Solvers
-
172 Solvers
More from this Author31
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!