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

Can anyone help me with turning fractions into decimals 2 1/2
Cellular respiration involves a series of chemical reactions. Which of the following is a primary way that enzymes affect these reactions? A. They decrease the
What happens at a conservative plate boundary? Someone please help me in this because I have test today. Aswell please don't copy it from the internet.
What is 10 percent of 80
Maria exercises for 2 1/7 hours every Saturday. She runs for 1/3 of the time that she exercises. How much time does she spend running every Saturday?
If a+b=6 and a-b = 4, what is the value of 2a + 3b?
How many quarts in 24 pints?
what were the main ideas of the reformation?
Cellular respiration involves a series of chemical reactions. Which of the following is a primary way that enzymes affect these reactions? A. They decrease the
How Do Clownfish Catch Their Food?