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 .
2 ответов
+ 1
int main() {
int n,f=1;
n=5;
while(n>0)
{
f=f*n;
n--;
}
printf("Factorial=%d",f);
return 0;
}
0
n=input ()
f=1
for i in range(1,n+1):
f=f*i
print (f)