Program to print non square numbers | Returns n - th non - square number . ; loop to print non squares below n ; Driver Code
function nonsquare ( n ) { return n + parseInt ( 0.5 + Math . sqrt ( n ) ) ; } function printNonSquare ( n ) { for ( let i = 1 ; i <= n ; i ++ ) document . write ( nonsquare ( i ) + " " ) ; } let n = 10 ; printNonSquare ( n ) ;