Check whether the number can be made perfect square after adding K | Function to check whether the number can be made perfect square after adding K ; Computing the square root of the number ; Print Yes if the number is a perfect square ; Driver code
function isPerfectSquare ( x ) { var sr = Math . round ( Math . sqrt ( x ) ) ; if ( sr * sr == x ) document . write ( " " ) ; else document . write ( " " ) ; } var n = 7 , k = 2 ; isPerfectSquare ( n + k ) ;