We need to check whether a number is a perfect square or not without finding its square root.
Input : n = 36
Output : Yes
Input : n = 12
Output : No
We have discussed a method to check if a number is perfect square.
The idea is to run a loop from i = 1 to floor(sqrt(n)) then check if squaring it makes n.
- Smallest N digit number whose sum of square of digits is a Perfect Square
- Check if given number is perfect square
- Find smallest perfect square number A such that N + A is also a perfect square number
- Check whether the number can be made perfect square after adding K
- Check whether the number can be made perfect square after adding 1
- Check if a given number is a Perfect square using Binary Search
- Check perfect square using addition/subtraction
- Euler's criterion (Check if square root under modulo p exists)
- Square root of a number using log
- Check if product of array containing prime numbers is a perfect square
- Largest number that is not a perfect square
- Perfect Square factors of a Number
- Square root of a number without using sqrt() function
- C program to find square root of a given number
- Largest factor of a given number which is a perfect square
- Largest perfect square number in an Array
- Find the Next perfect square greater than a given number
- Square root of a number by Repeated Subtraction method
- Largest Divisor of a Number not divisible by a perfect square
- Largest N digit Octal number which is a Perfect square
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.