+ 2
How to calculate factorial and the series must be visible
Use C language
2 Réponses
+ 1
a = input()
fact=1
for i in range(1,a+1):
print(str(i)+"*",endl='')
fact=fact*i
print(fact)
0
#include <stdio.h>
int main()
{
int n,i;long int fact=1;
printf("Enter n value");
scanf("%d",&n);
printf("\n n value is %d ",n);
for(i=1;i<=n;i++)
{
fact = fact * i;
}
printf("\n factorial is %ld ",fact);
}