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

How is bias shown in an argument?
What system works with the cardiovascular system to regulate temperature in the body?
What is the product of the functions f(x)=x^2 and g(x)=x-8?
Which of the following forms of pollution pose the greatest threat to the delicate balance of life on earth
which is regulated as a result of dam building
50 PIONTS+BRAINILIST ANSWER HURRY Which of the following shows 20 + 15 rewritten using the distributive property and the GCF of the addends? 10(2 + 2) 5(4 + 3)
Which excerpt from Nadine Gordimer’s “Once Upon a Time” best supports the idea that the narrator of the story does not believe that the family is living happily
Which excerpt from Nadine Gordimer’s “Once Upon a Time” best supports the idea that the narrator of the story does not believe that the family is living happily
When Beowulf fights Grendel, what two things kill Grendel?
Don't know what x is and if it's radical must be in simplest form