Dear All,
I have problem regarding the following, can anyone help, please...
/* function aim : should ask for the number of summation terms and print out the result.
e.g if the input is 2, the answer should be
x=1/2 + 1/3 = 0.8333
if the input is 4, the anwer should be x=1/2+1/3+1/4+1/5 =
1.2833,*/
int sum_Sequence (int n)
{float answer;
if (n==0)
answer = 0;
else
answer = 1/n+1 + sum_sequence(n-1);
return (answer);
}