1 | #include <stdio.h> |
2 | #include <conio.h> |
3 | void main() |
4 | { |
5 | clrscr(); |
6 | long fact=0; |
7 | printf("Enter a value to find it's factorial"); |
8 | scanf("%ld",&fact); |
9 | for(int i=(fact-1);i>0;i--) |
10 | { |
11 | fact=fact*i; |
12 | } |
13 | printf("%ld",fact); |
14 | getch(); |
15 | } |
16 |
|