Ask your own question, for FREE!
Mathematics 9 Online
OpenStudy (anonymous):

help write java s= 1!+2!+3!+.....n!

OpenStudy (anonymous):

observe \(1!+2!+3!=1+2(1+3)\), \(1!+2!+3!+4!+5!=1+2(1+3(1+4(1+5)))\), etc.

OpenStudy (anonymous):

this suggests a simple iterative approach

OpenStudy (anonymous):

can u write example in java

OpenStudy (anonymous):

okay: static int factsum(int n) { int v = 1; while (n > 1) { v = 1 + n-- * v; } return v; }

OpenStudy (anonymous):

http://ideone.com/to3bzf

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!