Code:

unsigned int SumQ(int a[],int n)
{
   unsigned int temp = 0;
   for(int i=0;i<n;i++)
      temp+=a[i]*a[i];
   return temp;
}