Factorials are used frequently in probability problems. The factorial of a positive integer n (written n! and pronounced “n factorial”) is equal to the product of the positive integers from 1 to n. Write an application that calculates the factorials of 1 through 20. Use type long. Display the results in tabular format. What difficulty might prevent you from calculating the factorial of 100?
What will be an ideal response?
The value of 100! far exceeds the maximum value that can be stored in a long. Forcalculations involving large integer values, you can use class java.math.BigIntegerinstead.
You might also like to view...
Which of the following is a property of a file in Windows Vista?
A) program where the file was created B) date archived C) date printed D) read-only
The command find . name "?" print
a: starts from the current directory, and finds all files with filename ? b: starts from the home directory, and finds all files with filename ? c: starts from the root directory, and finds all files that have a ? mark as part of their filenames d: starts from the current directory, and finds all files with one character filename e: none of the above