// DMN

// Program that uses recursion to return

// the sum of the squares 1^2 + 2^2 +...+ 10^2

 

#include <iostream>

using namespace std;

 

int sumSquare(int k);

 

int main()

{

  int a, n = 10;

 

  a = sumSquare(n);

  cout << a;

 

  return 0;

}

 

int sumSquare(int k)

{

  // Base case

  if (k == 1)

    return 1;  // 1^2 is 1

 

  // Recursive case

  int p = sumSquare(k - 1); //winds down towards base case

  int ans = p + k*k;        // builds answer

  return ans;

}