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

Esteban counted the number of steps it took him to walk to school.He counted 1,138 steps.How many steps does he take walking to and from school each day?
If two objects at different temperatures are in contact with each other, what happens to their temperatures?
How do the skeletal system and the lymphatic system work together to protect the body from disease?
Value of 3y - 10 when y = -1
What is 7 hundred x 10 in unit form?
4 L 342 mL + 2L 214 mL =
Find the energy in joules required to lift a 55.0 megagram object a distance of 500cm
how to put 8x - 7y = 23 into slope intercept form
Which of these forces attract a positive charge towards a negative charge? a. gravitational force b. electromagnetic force c. weak nuclear force d. strong nucle
-x² + 4x - 4 = 0 Solve the equation