WAP to find the sum of the series S=a/2+a/3+a/4+a/5+......+a/n
Answers
Answered by
1
Answer:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float i,x,sum=1,p=1;
int n;
cout<<" \n a/2+a/3+a/4+a/5+......+a/n ";
cout<<" \n Enter the value of a : ";
cin>>x;
cout<<" \n Enter the value of n : ";
cin>>n;
for(i=1;i<=n;i++)
{
p=p*x/i;
sum=sum+p;
}
cout<<"\n Sum="<<sum;
getch();
}
Explanation:
C++ code
Similar questions
Math,
2 months ago
Hindi,
2 months ago
Math,
2 months ago
Psychology,
5 months ago
English,
5 months ago
Computer Science,
11 months ago
Physics,
11 months ago