Average of Squares of Natural Numbers | Function to calculate average of square number ; Driver code
< ? php function AvgofSquareN ( $ n ) { $ sum = 0 ; for ( $ i = 1 ; $ i <= $ n ; $ i ++ ) $ sum += ( $ i * $ i ) ; return $ sum / $ n ; } $ n = 2 ; echo ( AvgofSquareN ( $ n ) ) ; ? >