F How to find factorial of any given number? [using C] | CodeTheta

How to find factorial of any given number? [using C]

May 18, 2013

Here is a simple a factorial calculation program which is written is C . Code is written in very easy process.
here you can see the simple program of factorial. This program calculate the given value using function , here you can see i use factorial function, and after that i pass the integer value in to this. In starting portion of the program we use two integer to calculate the value.

n= number entered by the user.
f= factorial value of the number which is entered by the user.

In the last portion of the program you can see, that's the main logic of the factorial programming. Main pseudo code is: n*factorial(n-1)

void main()
int n,f;
int factorial(int);
printf("/* http://codetheta.com */");
printf(""\n Enter The Number: ");
printf("\n Factorial is: %d",f);
int factorial(int n)

For better understanding you have to run this code in you PC.

Post a Comment