answersLogoWhite

0


Best Answer

hi friend

hope u got the ans:

int main()

{

int count=1,n,fact=1;

printf("Enter the value which u need for factorial");

scanf("%d",&n);

while(count<=n)

{

fact=fact*count;

count++;

}

printf("%d",fact);

getch();

}

The answer will get out of the scope of "int" when reaching 10! or 12!, so the upper answer is not accurate but in case of syntax it is good.

Below I have used array rather than simple int or long to store the multiplied results.

#include

#include

#define MAX 10000

int len = 0;

int fact[MAX];

void factorial(int);

void multiply(int);

void main()

{

int n,i;

clrscr();

printf("\nEnter any integer number : \n");

scanf("%d",&n);

fact[0]=1;

factorial(n);

printf("\nFactorial of %d is :\n",n);

for(i=len;i>=0;i--){

printf("%d",fact[i]);

}

getch();

}

void factorial(int n)

{

int i;

for(i=2;i<=n;i++){

multiply(i);

}

}

void multiply(int n)

{

long i,r=0;

int arr[MAX];

for(i=0;i<=len;i++)

{

arr[i]=fact[i];

}

for(i=0;i<=len;i++)

{

fact[i] = (arr[i]*n + r)%10;

r = (arr[i]*n + r)/10;

}

if(r!=0)

while(r!=0)

{

fact[i]=r%10;

r= r/10;

i++;

}

len = i-1;

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

7y ago

The built-in types do not allow you handle factorials greater than 20! A long double will extend the range through approximation, but to calculate 100! you will need to design a user-defined type that can store a variable-length integer and perform the multiplication manually.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

long n, factorial;

for (n=1, factorial=1; n <= 10; n++) {

factorial *= n;

printf ("%d %d\n", n, factorial);

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How you find factorial of 100 in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write the Pseudocode to find the factorial of a number?

Pseudo code+factorial


Mini project in c language with coding?

C Program to find factorial of a numberSimple C Programint main() {int n,i,f=1;printf("enter any num \n");scanf("%d",&n);for(i=1;i


What is 100 factorial?

100*99*...*2*1= 93326215443944152681699238856266700490715968264381621468592963895217 59999322991560894146397615651828625369792082722375825118521091686400 0000000000000000000000


Write a C-like program fragment that calculate the factorial function for argment 12 with do while loop?

#!/usr/bin/perl print factorial($ARGV[11]); sub factorial { my($num) = @_; if($num == 1) { return 1; # stop at 1, factorial doesn't multiply times zero } else { return $num * factorial($num - 1); # call factorial function recursively } }


How do you create factorial program in qbasic?

since factorial is for example , the factorial of 5 = 5 (5-1)(5-2)(5-3)(5-4) that means the last number to subtract from 5 is 4 , which is (n-1) ie the factorial of any number is (n-0)(.............)(n-(n-1)) to write this , 5 REM to calculate the factorial of any number 6 DIM fac AS INTEGER LET fac = 1 10 INPUT "enter the number to find its factorial "; a ' variable a 15 FOR b = 0 TO (a-1) 'numbers that will be subtracted from the " a" 20 c= a -b 'each number in the factorial calculation 25 fac = fac * c 'to compute each multiplication in the factorial 30 NEXT b 35 PRINT 'to leave a line 40 PRINT fac 45 END note this due to some unattained raesons works for numbers 0 to 7

Related questions

No of trailing zeros in factorial 100?

There are 24 trailing zeros in 100 factorial.


C program to find factorial of a no?

this is a code for calculating it recursivelly: float Factorial (float n) { if (n&lt;=1) return 1.0; else return n* Factorial(n-1); }


What is 100 factorial divided by 97 factorial?

1.0309


What is factorial of 100?

9.33262222e+157


What is the logic and theory for pascal triangle program in C?

long factorial(int); int main() { int i, n, c; printf("Enter the number of rows you wish to see in pascal triangle\n"); scanf("%d",&n); for ( i = 0 ; i < n ; i++ ) { for ( c = 0 ; c


What is the value of abc if abc equals a factorial plus b factorial plus c factorial?

145 1! = 1 4! = 24 5! = 120


How do you find factorial 5 in C programming?

to find the factorial we declare a variable n and initialize its value to 1 initiate a loop for example a for loop and multiply the numbers upto 5 code:- for(i=1,n=1;i&lt;=5;i++) { n=n*i; }


Write the Pseudocode to find the factorial of a number?

Pseudo code+factorial


Program to find the factorial of a number using recursion?

/*program to find the factorial of a given number*/ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; int fact(int); void main() { int n,c; printf("\n enter the number for which you want to find the factorial"); scanf("%d",&amp;n); c=fact(n); printf("\n the factorial of the number %d is %d",n,fact); getch(); } int fact(int n) { int k; if(n==0) return(1); else k=n*fact(n-1); return(k); }


Mini project in c language with coding?

C Program to find factorial of a numberSimple C Programint main() {int n,i,f=1;printf("enter any num \n");scanf("%d",&n);for(i=1;i


What is 100 factorial?

100*99*...*2*1= 93326215443944152681699238856266700490715968264381621468592963895217 59999322991560894146397615651828625369792082722375825118521091686400 0000000000000000000000


What is 100 factorial divided by 2 factorial?

50