# factorial of a large number

How to get factorial of a number larger than 100?

this link might be of help to you

Use BigInteger in java. That is the easiest way.

1 Like

BigInteger is one possible solution

my name is amardeep and i am just 13 but this is the simpliest way to calculate factorial â€¦ by using for loop

#include <stdio.h>

int main()
{
int c, n, fact = 1;

printf(â€śEnter a number to calculate itâ€™s factorial\nâ€ť);
scanf("%d", &n);

for (c = 1; c <= n; c++)
fact = fact * c; // fact intial value is 1 so when the loop starts it keeps on multplying fact *c until the condition becomes falseâ€¦ it also changes the value of c variable

printf(â€śFactorial of %d = %d\nâ€ť, n, fact);

return 0;
}

my name is amardeep and i am just 13 but this is the simpliest way to calculate factorial â€¦ by using for loop

#include <stdio.h>

int main()
{
int c, n, fact = 1;

printf(â€śEnter a number to calculate itâ€™s factorial\nâ€ť);
scanf("%d", &n);

for (c = 1; c <= n; c++)
fact = fact * c; // fact intial value is 1 so when the loop starts it keeps on multplying fact *c until the condition becomes falseâ€¦ it also changes the value of c variable

printf(â€śFactorial of %d = %d\nâ€ť, n, fact);

return 0;
}

Excuse me brother, since you code in C++ 4.3.2 have look at this : http://ideone.com/Q6PiJB

3 Likes