English, asked by aditisingh4b, 5 hours ago

what is the factorial of hundred ​

Answers

Answered by rawatsatendra330
1

Answer:

It can be calculated easily using any programming Language. But Factorial of 100 has 158 digits.

Explanation:

Answered by 120287
0

Answer:

Factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. Logic of calculating Factorial is very easy .

5! = 5 * 4 * 3 * 2 * 1 = 120. It can be calculated easily using any programming Language.

But Factorial of 100 has 158 digits. It is not possible to store these many digits even if we use "long long int". Following is a simple solution where we use an array to store individual digits of the result.

Here, I will try to give you a step by step method to solve the problem in C++/C:

factorial(n):

Create an array ‘res[ ]’ of MAX size where MAX is number of maximum digits in output.

Initialize value stored in ‘res[ ]’ as 1 and initialize ‘’ (size of ‘res[ ]’) as 1.

Do following for all numbers from x = 2 to n..

a) Multiply x with res[ ] and update res[ ] and to store the multiplication result.

multiply(res[ ], x)

Initialize carry as 0.

Do following for i = 0 to  

a) Find value of res[i] * x + carry. Let this value be prod.

b) Update res[i] by storing last digit of prod in it.

c) Update carry by storing remaining digits in carry.

Put all digits of carry in res[ ] and increase  by number of digits in carry

Similar questions