Number of perfect squares between two given numbers | Function to count squares ; Driver code
function countSquares ( a , b ) { return ( Math . floor ( Math . sqrt ( b ) ) - Math . ceil ( Math . sqrt ( a ) ) + 1 ) ; } let a = 9 ; let b = 25 ; document . write ( " " , countSquares ( a , b ) ) ;