Pl. Help me in solving factorial of any number in c languguage
Given an positive integer n, the factorial of that number is the product of that number with all the numbers that preceed it. It is denoted by n!, pronounced n factorial.
n! = n*(n-1)*(n-2)*.....3*2*1
0!=1
1!=1
by convention.
To write a function which computes n! you could use recursion or a control structure, for/ while loop.
The structure of a function that computes the factorial might go as follows
Step 1: Error condition that eliminates the calculation of factorials of negative integers.
Step 2: Define the base cases 0!=1, 1!=1
Step 3: Implement the factorial algorithm as defined above.
Hope this has been of some help.