### Factorial Number

**FACTORIAL NUMBER**

**The factorial of a positive integer n, denoted by**

*n*!, is the product of all positive integers less than or equal to n. For example,**{\displaystyle 5!=5\times 4\times 3\times 2\times 1=120\,.}**

**The value of 0! is 1, according to the convention for an empty product**

**Mathematically, the formula for the factorial is as follows. If**

*n*is an integer greater than or equal to 1, then

*n*! =*n*(*n*- 1)(*n*- 2)(*n*- 3) ... (3)(2)(1)**If**

*p*= 0, then*p*! = 1 by convention.

**We can easily calculate a factorial from the previous one:**

**As a table:**nn!1

**1**1122 ×

**1**= 2 ×

**1!**= 233 ×

**2 × 1**= 3 ×

**2!**= 644 ×

**3 × 2 × 1**= 4 ×

**3!**= 2455 ×

**4 × 3 × 2 × 1**= 5 ×

**4!**= 1206etcetc

C Program for Factorial of a Number

#include<stdio.h>int main(){int n, i;unsignedlonglong factorial =1; printf("Enter an integer: "); scanf("%d",&n);// show error if the user enters a negative integerif