Check whether a number can be represented as difference of two squares | Function to check whether a number can be represented by the difference of two squares ; Checking if n % 4 = 2 or not ; Driver code
function difSquare ( n ) { if ( n % 4 != 2 ) { return true ; } return false ; } var n = 45 ; if ( difSquare ( n ) ) { document . write ( " " ) ; } else { document . write ( " " ) ; }