Check whether a number can be represented by sum of two squares | function to check if there exist two numbers sum of whose squares is n . ; driver Program
function sumSquare ( n ) { for ( i = 1 ; i * i <= n ; i ++ ) for ( j = 1 ; j * j <= n ; j ++ ) if ( i * i + j * j == n ) { document . write ( i + " " + j + " " + " " ) ; return true ; } return false ; } var n = 25 ; if ( sumSquare ( n ) ) document . write ( " " ) ; else document . write ( " " ) ;