Computer Science, asked by priyakumari53, 11 months ago

write a java program in bluej to print the sum of the given series.​

Attachments:

Answers

Answered by sswaraj04
3

Answer:

import java.util.Scanner;

import java.lang.Math;

public class StringDemo {

  public static void main(String args[]) {

      Scanner sc=new Scanner(System.in);

      System.out.println("Enter no. of terms till you want sum : ");

      int n=sc.nextInt();

      System.out.println("Enter value of x");

      int x=sc.nextInt();

      float sum=0;

      for(int i=2;i<=2*n;i=i+2)

      {

         sum+=Math.pow(x,i)/(i+1);

      }

      System.out.println(sum);

  }

}

Explanation:

Hope it helps :-)

Answered by seulidas
0

Answer:

sorry dood

Explanation:dont know

Similar questions