Average of Squares of Natural Numbers | C # program to get the Average of squareof first n natural numbers ; Function to calculate average ; Driver Code
using System ; public class GFG { static float AvgofSquareN ( int n ) { return ( float ) ( ( n + 1 ) * ( 2 * n + 1 ) ) / 6 ; } static public void Main ( String [ ] args ) { int n = 2 ; Console . WriteLine ( AvgofSquareN ( n ) ) ; } }