**Series Solving Using Recursion**

In this program we are going to evaluate sum of the series given in question above.

To learn basics of function in C programming Click Here.

**Example :**

#include<stdio.h> #include<conio.h> long float recursion(float n); void main() { float x,ser=0,ser1=0,i,sum=0,z,n; clrscr();
//To take x from user printf("\nEnter x:"); scanf("%f",&x);
printf("\nEnter n:"); scanf("%f",&n);
//To calculate positive part of series for(i=1;i<=n;i+=4) ser=ser+(x*i)/recursion(i); //To calculate negative part of series for(i=3;i<n;i+=4) ser1=ser1+(x*i)/recursion(i);
//Sum of series sum=ser-ser1; //printf("%f",ser); //To print series and it's sum printf("\nSum of series = %.4f",sum); getch(); }
//To calculate factorial of base value long float recursion(float n) { if (n>=1) return n*recursion(n-1); else return 1; } |

**Output :**

**For More GTU C Programming Lab Experiments Click Here**