Factorial program in C using Function. Factorial can be denoted by the symbol ‘!’. In many engineering calculations, you will come across the symbol ! which you may not have met before in mathematics classes. This is known as a factorial. The number 5 × 4 × 3 × 2 × 1 is written as 5! which is read as ‘five factorial’

## C Program to find Factorial using Functions

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include<stdio.h> long factorial(int); main() { int number; long fact = 1; printf("Enter a number to calculate it's factorial\n"); scanf("%d",&number); printf("%d! = %ld\n", number, factorial(number)); return 0; } long factorial(int n) { int c; long result = 1; for( c = 1 ; c <= n ; c++ ) result = result*c; return ( result ); } |

**OUTPUT of Factorial program in C using Function**

1 2 | Enter a number to calculate it's factorial 6! = 720 |

You can learn about Java Program to find a Factorial of a number here and for queries go to quora

## 1 thought on “Factorial program in C using Function”

Comments are closed.