text: Average of Squares of Natural Numbers | C program to get the Average of Square of first n natural numbers ; Function to get the average ; Driver Code
code: #include <stdio.h> NEW_LINE float AvgofSquareN ( int n ) { return ( float ) ( ( n + 1 ) * ( 2 * n + 1 ) ) / 6 ; } int main ( ) { int n = 10 ; printf ( " % f " , AvgofSquareN ( n ) ) ; return 0 ; }