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

A classmate is texting a false rumor around school that another student was arrested for shoplifting. This behavior can be described as denigration harassment
The Travels of Marco Polo focused on the exploration of Marco Polo in which part of the world?
A farmer grows vegetables on seven acres, fruit on six acres, and flowers on two acres. Out in his fields, he finds a ladybug. To the nearest tenth of a percen
The play will be negative 12 degrees tonight, the weatherman predicts it will be 25 degrees warmer by noon tomorrow, what was the temperature be by noon tomorro
Please help me with this.
Hamlet act 1 what is the scene as the play opens
What is cos(5x3.14/3)
why was Nepal declared a federal state ​
) a 45-mh ideal inductor is connected in series with a 60-ω resistor through an ideal 15-v dc power supply and an open switch. if the switch is closed at time t
What percent of all African Americans in the United States in 1860 lived in the North?