Saturday, November 10, 2012

Java Exercise #49: Large Factorial

If we need to compute very huge numbers or high-precision floating point values, we need to use BigInteger and BigDecimal classes in the java.math package. Both these classes are immutable and also implements Comparable interface. You can use add, subtract, multiple, reminder etc. methods to perform computations.

Exercise: Write a program that prints the value for 50!


50! is 30414093201713378043612608166064768844377641568960512000000000000

Download Code: Large Factorial

No comments:

Post a Comment