C program for factorial

Prev     Next

C program example for factorial:

What is factorial of a number?

  • Factorial is denoted by the symbol ‘!’. For example, factorial of a number 4 is denoted as 4!. Factorial of a number is defined as the product of “the number and all integers less than that number except zero and negative integers”.
  • Natural numbers ( non-negative integers ) which are greater than zero are used for factorial concept.

Factorial Example:

Zero factorial (0!) = 1
one factorial (1!) = 1
Two factorial (2!) = 2*1 = 2
Three factorial (3!) = 3*2*1 = 6
Four factorial (4!) = 4*3*2*1 = 24
Five factorial (5!) = 5*4*3*2*1 = 120
etc…

The common mathematical formula for finding factorial of the number ‘n’ is given below.

n! = n ( n – 1)( n – 2)( n – 3) …… (1)

Example C program for factorial:

Output of C program for factorial:

Please enter a number to find factorial : 7
Entered number is 7 and it’s factorial (7!) is 5040

Prev     Next

Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin

Close
We Support JALLIKATTU !!!
We Support JALLIKATTU!
By Fresh2Refresh.com
Show Your Support as well. Thanks!