#include <iostream>

float summation(const float (&a)[10], int n ) 
{ 
     float s = 0;
     int i;
     for(i = 0; i<n; i++) {
        s+= a[i];
     }
     return s;
}

void main(){
   float a[10];
   int i;

   for (i=0; i<10; i++){
      a[i] = i * i;
   }
   cout << "Sum of 1^2 + ... + 10^2 is " << summation(a,10) << endl;
}

