Arithmetic Mean | Prints N arithmetic means between A and B . ; Calculate common difference ( d ) ; For finding N the arithmetic mean between A and B ; Driver code
function printAMeans ( A , B , N ) { let d = ( B - A ) / ( N + 1 ) ; for ( let i = 1 ; i <= N ; i ++ ) document . write ( ( A + i * d ) + " " ) ; } let A = 20 , B = 32 , N = 5 ; printAMeans ( A , B , N ) ;