**C Program Code**

//factorial of a number

#include "stdio.h"

#include "conio.h"

void main()

{

int fact=1,n;

clrscr();

printf("enter any number");

scanf("%d",&n);

while(n>0)

{

fact=fact*n;

n--;

}

printf("\n factorial of given number= %d",fact);

getch();

}

**Input/Output**

enter any number 4

factorial of given number= 24

Factorial of 4 = 4*3*2*1 =24