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

List all integers between -0.6 and 4.17 THANK U
Compute the odds in favor of rolling a sum of 10 in a single roll of two fair dice
An object with mass 60 kg moved in outer space. When it was at location < 13, -19, -3 > its speed was 3.5 m/s. A single constant force < 220, 320, -120
The Habsburg Empire did all of the following EXCEPT A. take control of Hungary, Croatia, and Slovonia. B. lose their Holy Roman Empire in Germany. C. remain a c
which foods earthworms can digest?
Six popular brands of tea are to be used in a blind taste study for consumer recognition. If three distinct brands are chosen from the six, and if the consumer
List all integers between -0.6 and 4.17 THANK U
what does como eres tu mean in spanish?
How would you define psychological realism?
let g(x)=x-3 and h(x)=x^2+6 find (h o g) (1)