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

Triangle QRS has vertices Q(8, –6), R(10, 5), and S(–3, 3). What are the coordinates of the vertices of the image of the triangle after a translation of T–7.6,
1/2 of an 8-ounce glass of water?
Which term best describes the shapes below that are the same shape but not the same size
i know it’s not a ser choice a but im still not sure
How does the heading serve the authors purpose
Which of the following structures is a double layer of phospholipids with proteins? A: cytoplasm B: cell membrane C: ribosome D: cell wall
Which step is the same in both forms of fermentation, as well as in cellular respiration?
what is a long-term benefit of healthy eating?
Although cellular respiration involves many steps, the whole process can be represented by a single equation. A + B → C + D + E Which sub
Wich technque is not recommended for use as a supporting detail