I am trying to use a recursion instead of a loop to calculate the sum of squares of n. n is a number 1 to 100 that the user enters.

Here is my program so far but I think I messed it up... can't make it to work.......help!

Code:#include <stdio.h> void recursion(int k, long n); int main(void) { long n,sum; printf("Enter n: "); scanf("%ld", &n); printf("You entered: n= %ld\n",n); if (n>100) { printf("squares n is larger than 100\n"); return 1; } recursion(1,n); printf("sum=%ld\n",sum); return 0; } void recursion(int k,long n) { long sum=0; if (k<=n) recursion(sum+=k*k,0); return ; }