Write a program that computes the factorial function for an input positive integer n. We define
The goal is to compute factorial for large numbers. So you must
compute all the digits accurately. You may assume that the output
has at most 100 digits.
Each line contains a positive integer for which you must compute a factorial. A line containing zero indicates end of input.
Output the factorial for each input, each on its own line.
Input: | Output: |
---|---|
5 20 0 |
120 2432902008176640000 |
Input | Output |
---|
Bill Pugh