Check if a number has an odd count of odd divisors and even count of even divisors | Function to check if the number is a perfect square ; Find floating point value of square root of x . ; If square root is an integer ; Function to check if count of even divisors is even and count of odd divisors is odd ; Driver Code
function isPerfectSquare ( x ) { sr = Math . sqrt ( x ) ; return ( ( sr - Math . floor ( sr ) ) == 0 ) ; } function checkFactors ( N ) { if ( isPerfectSquare ( N ) ) document . write ( " " + " " ) ; else document . write ( " " + " " ) ; } N = 36 ; checkFactors ( N ) ;