Plss answer this question .It's urgent ....
plss fast....
Attachments:
Answers
Answered by
1
Answer:
class Choice
{
void SumSeries(int n,double x)
{
double sum=0.0;
int i;
(for i=1;i<=n;i++)
{
if(i%2==0)
sum=sum-(double)x/i;
else
sum=sum+(double)x/i;
}
System.out.println("Sum of first series:"+sum);
}
void SumSeries()
{
int i,p=1,sum1=0;
for(i=1;i<=20;i++)
{
p=p*i;
sum1=sum1+p;
}
System.out.println("Sum of second series:"+sum1);
}
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int n;
double x;
System.out.println("enter last limit of the series");
n=in.nextInt();
System.out.println("enter the value of x");
x=in.nextDouble();
Choice ob=new Choice();
ob.SumSeries(n,x);
ob.SumSeries();
}
}
Explanation:
plz markbrainlist
Similar questions
Math,
5 months ago
English,
5 months ago
Social Sciences,
5 months ago
Science,
9 months ago
English,
9 months ago
Social Sciences,
1 year ago