Computer Science, asked by chiragsinghal21, 1 year ago

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 sswaraj04
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