suzen123
suzen123 suzen123
  • 04-01-2021
  • Computers and Technology
contestada

JAVA
Write a program to find the sum of the given series:
S = 1 + (1*2) + (1*2*3) + --------- to 10 terms.

plz help....​

Respuesta :

Cytokine
Cytokine Cytokine
  • 04-01-2021

public class MyClass {

   public static void main(String args[]) {

     int x = 1;

     int total = 0;

     for (int i = 1; i <= 10; i++){

         x *= i;

         total += x;

     }

     System.out.println(total);

   }

}

This program finds the sum of that series to the tenth term, the sum is: 4037913. I hope this helps.

Answer Link

Otras preguntas

-2m + 4m + 5 = -3 Tell me what you did please!
what is the imaginary line that circles the globe halfway between the North and South poles
What's the algebraic expression of "4 times a number cubed decreased by 7"?
What's the square root of 98
How to find the quotient for 10/5
what is 24 ten thousands
What is 3.82 rounded to the nearest whole number?
3312 divided by 48 long division
What prevents ions from crossing the plasma membrane via simple diffusion? A. Ions are too large. B. Ions carry a charge. C. Ions are hydrophobic. D. Ions do n
Is the square root of 2 between 1.3 and 1.4? how do you know!