write algorithm to find whether a number is perfect square python code example
Example 1: how to check sqrt of number is integer c++
bool isPerfectSquare(long double x)
{
// Find floating point value of
// square root of x.
long double sr = sqrt(x);
// If square root is an integer
return ((sr - floor(sr)) == 0);
}
Example 2: python num perfect squares
print(int(int(n)**.5))