How to find factorial ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to find factorial ?

factorial is just the multiplication of all numbers which are smaller that it , excluding 0 . It is denoted by symbol ! . For example factorial of 5 (!) = 5 *4*3*2*1 = 120 , 3!=3*2*1=6 . exceptions 1!= 1 and 0! =1 .

6th Apr 2018, 4:06 PM
happy singh
2 Answers
+ 1
int main() { int n,f=1; n=5; while(n>0) { f=f*n; n--; } printf("Factorial=%d",f); return 0; }
6th Apr 2018, 4:19 PM
Manorama
Manorama - avatar
0
n=input () f=1 for i in range(1,n+1): f=f*i print (f)
6th Apr 2018, 4:21 PM
Пиров Мустафо
Пиров Мустафо - avatar