Find the average of first N natural numbers | Return the average of first n natural numbers ; Driver Code
< ? php function avgOfFirstN ( $ n ) { return ( float ) ( 1 + $ n ) / 2 ; } $ n = 20 ; echo ( avgOfFirstN ( $ n ) ) ; ? >