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 foods are good for skin and hair, and what vitamins do they have in them???please answer this, need the answer URGENTLY!!!
Will someone please explain how to do -(7c-18)-2>0 Step for step??? I don't understand how to.
A grocery store receipt shows 5% state tax due on laundry detergent and a flower bouquet. Does it matter whether the tax is calculated on each separate item o
solve y+4x=12 3y=8-12x
When the body receives stimuli, which structure typically processes the stimuli?
I am trying to find the magnitude of a resultant vector. Do i take inconsideration the negatives when i find the x & y components of the two vectors
89.36 rounded to the ones place
Hi how do you write the number 31 in Italian? Thanks need this answer tonight plz homework is due tomorrow
is 2 squared between 1.4 and 1.5
3.7 times 9.4 show work