Check out example codes for "how to check sqrt of number is integer c++". It will help you in understanding the concepts better.

Code Example 1

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); 

Learn ReactJs, React Native from