C C++ Java

How to find factorial of large numbers using java and c++2 min read

In this article I am going to show you to represent factorial of large number in java and c++.

It is not possible to store factorial for large number like 50 into inbuilt data types like integer or long. Because factorial of 50 has almost 60 digits. Imagine how we can store it in int or long. We can find factorial of such numbers using BigInteger class defined in java.math package.

Program for Factorial of Large Number in Java




To get the Factorial in c and c++  For example factorial of 100 has almost 158 digits. So there is no data type available to store such a long value. But we can find factorial for large numbers using simple multiplication method that we used in our school time. Below I have shared the program for it.

Program for Factorial of Large Number in C

Program for Factorial of Large Number in C++

Take your time to comment on this article.

Leave a Comment