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

what is equal to 59/1000
Calculate the number of moles in 0.457 grams of NaCl, sodium chloride
these students have an increase in sadness and depression question 7 options: a) elementary school b) middle school c) high school
If y varies directly as x and y is 400 when x is r and y is r when x is 4, what is the numeric constant of variation in this relation?
4x^2 20x 25=0 factor
atoms of different elements are. a. too hard to compareb. exactly the same.c. different from each other.
TRUE or FALSE. The incenter of a triangle is the only circle that can be circumscribed about it.
What are a few of the positive things the Equal Rights Amendment would have done for women in America?
Which best describes a purpose of the Ku Klux Klan in the 1860s and 1870s? to intimidate blacks and white Republicans to murder blacks and white Republicans to
The carpals are bones found in the