Implement the recursive function
form (n): returns the value of the sum of i * i, with i varying from 1 to n.
I've tried it here, but it's not right:
include <stdio.h>
include <stdlib.h>
int form(int n){
if(n==1){
return n;
}
return n + form(n-1);
}
int main()
{
int n;
scanf("%d", &n);
printf("%d", form(n));
return 0;
}