Check whether a number can be represented by the product of two squares | Function to check if there exist two numbers product of whose squares is n . ; Check whether the product of the square of both numbers is equal to N ; Driver code
function prodSquare ( n ) { for ( i = 2 ; i * i <= n ; i ++ ) for ( j = 2 ; j <= n ; j ++ ) if ( i * i * j * j == n ) return true ; return false ; } var n = 25 ; if ( prodSquare ( n ) ) document . write ( " " ) ; else document . write ( " " ) ;