# Factorial Program in C | C program for Factorial of a Number

**Factorial :**In mathematics, the factorial of a non-negative integer

*n*, denoted by

*n*!, is the product of all positive integers less than or equal to

*n*. For example,

**5! = 5*4*3*2*1 i.e 120**

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

**/***************Program*************/**

1 |
#include<stdio.h><br />main()<br />{<br /> int n,fact=1,i;<br />Label: printf("Enter a Number :");<br /> scanf("%d",&n);<br /> if(n<0)<br /> {<br /> printf("No Factorial for Negative Non");<br /> goto Label;<br /> }<br /> else<br /> {<br /> if(n == 0)<br /> fact = 1;<br /> else<br /> {<br /> for(i=1;i<=n;i++)<br /> fact =fact*i;<br /> }<br /> }<br />printf("Factorial of %d is : %d..n",n,fact);<br />}<br /><br /> |

**/*********** OUTPUT ***************/**

1 |