Write a program in QBASIC and draw the flowchart to find the sum of the following series :
a) S = X + x² + x³ + x* + N x+1 x+2 x+3
b) S = .N %3D x+2 x+3 x+4
c) S = 0,1,1,2,3,5.. N d) S = 10,11,21,23,44.. N %D e) S = 1+2+9+28+65
Answers
Answered by
0
Answer:
Explanation:
#include<stdio.h>
#include<math.h>
int main()
{
int n,i=1,x,j,fact;
double sum=1.1;
printf("Enter the range of number:");
scanf("%d",&n);
printf("Enter the value of x:");
scanf("%d",&x);
while(i<=n)
{
fact=1;
for(j=1;j<=i;j++){
fact*=j;
sum+=pow(x,i)/fact;
}
i++;
}
printf("The sum of the series = %0.2lf",sum);
}
Similar questions