Write a C program to calculate the sum of following series using function.Sum=1+1/x+1/x2+1/x3+1/x4+………*/


#include<stdio.h>
#include<conio.h>
#include<math.h>
void series(int x);

void main()
{
  int x;
clrscr();
printf("\n enter the value od x");
scanf("\n %d",&x);
series(x);
getch();
}
void series(int x1)
 {
   int i,limit;
   float sum=0;
   printf("\n enter the limit");
   scanf("\n %d",&limit);
  for(i=1;i<=limit;i++)
 {
  sum=sum+(1/(pow(x1 ,i)));
}
printf("\n sum of series is %f",(1+sum));
getch();
}
/* output

 enter the value od x3
 enter the limit2

 sum of series is 1.444444 */