I am having difficulty with an assignment that has to deal with recursion in C.
We were asked to create a program (using recursion) to sum up a harmonic series.
This is what I have so far:
I am having trouble with the output, it doesn't return the correct value.
long Harmonic ( int n );
printf("This program prints a harmonic series.\n");
printf("How many numbers do you want?\n");
printf ("The sum of this harmonic series is: " "%ld\n", Harmonic(seriesSize));
long Harmonic ( int n )
if ( n == 0 )
result = 1;
Is my harmonic equation incorrect? Where am I going wrong?
Thanks for your help in advance!