write the program in Java to find the sum of following series: 1+(1+2)/(1×2)+(1+2+3)/(1×2×3)
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class HelloWorld{
public static void main(String []args)
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the term till you want sum of series");
int n=sc.nextInt();
int s=0,p=1;
double sum=0;
for(int i=1;i<=n;i++)
{
s+=i;
p*=i;
sum+=(double)s/p;
}
System.out.println("Sum of series is "+sum);
}
}
Explanation:
Hope it helps:-)
Mark me brainliest
Similar questions
Science,
6 months ago
Math,
1 year ago
History,
1 year ago
Social Sciences,
1 year ago
Chemistry,
1 year ago