Write a program to find out the sum of the series
1× x + x² + x² + .................. xn
Answers
Answered by
2
Explanation:
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int i,n;
float x,sum=0;
clrscr(); //to clear the screen
printf(“1+x+x^2+……+x^n”);
printf(“nnEnter the value of x and n:”);
scanf(“%f%d”,&x,&n);
for(i=1;i<=n;++i)
sum+=pow(x,i);
sum++;
printf(“nSum=%f”,sum);
getch(); //to stop the screen
}
Answered by
3
the sum of the series
#include<iostream.h>
void main()
{
int 1, x, x²....;
float sum;
cout<<"enter the value for variables;
cin>>1>>x²>>...;
sum=(1+x²+x²+...);
cout<<"Sum="<<sum_of_series;
}
Similar questions