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

help me please question in picture​
Why is partial pressure of oxygen greater at lower levels in water.
ruthless How is Judson’s preoccupation with what he believes is "fair" his downfall? .
You and a friend tutor for a total of 12 hours. Use the tape diagram to find how many hours you tutor.
A 0. 25 kg baseball is in contact with a bat for 0. 0075 s and exerts a force of 18,500 n. What impulse is delivered to the ball?.
I need help with #7, it’s 7 letters and uses o as the second letter and e as the second to last.
Functions or Not a Function? Explain?
How do i use the app.??
When was the korean war.
due rn for a test help