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

why are adults bigger than they were as children biology
Which of the following statements is true? Bacteria reproduce by budding. Egg and sperm cells reproduce by mitosis. Asexual reproduction usually occurs very sl
HELPPPPPP FASTTTT!!!!!!!!! Rosy waxes 2/3 of her car with 1/4 bottle of car wax.At this rate,what fraction of the bottle of car wax will rosey use to wax her en
Find an equation for the linear function which has slope -10 and x-intercept -7
A local concert promoter purchases 2 3/4 pages of ads. When one of the concerts is cancelled, the promoter cancels 1 5/8 pages of ads. How much advertising spac
Sarah tried to erase the files full of illegal __________ in her computer before the police arrived, but she was too late.
Why were the numbering trials held from 1945 to 1946 ?
In trapezoid EFGH, m∠GFE=63∘. Identify m∠GHE. HELP PLEASE!
In shooting an elephant by George Orwell how do the Burmese view the British
witch system has the main function of the body defense