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

The disease characterized by the unrestrained growth of abnormal cells in or on tissues of the body is known as: diabetes cancer hepatitis coronary heart diseas
On the pH scale, a 7 indicates _____. a base an acid neutrality
What did Bohr’s model of the atom include that Rutherford’s model did not have?
The relationship between a cathode and an anode involves A. protons. B. diodes. C. electrons. D. neutrons.
An oligarchy is best defined as
Example of a counter root word
Which sentence uses present tense? a. The catacombs was dark and cold, symbolizing death. b. Fortunato loved wine, so he was vulnerable to the plan. c. The p
When a star collapses to form a black hole, its mass _____. a. decreases b. remains the same c. increases
Does a worm have cartilage?
what type of scientist studies how bacteria are affected by antibiotics