calculate factorial in c

 #include<stdio.h>

int main()

{

int i, n, factorial=1;

printf("Enter the value of n");

scanf("%d", &n);

for(i=1;i<=n;i++){

factorial*=i;

}

printf("The value of factorial is %d is %d",n,factorial);

return 0;

}

Comments

Popular posts from this blog

create a num table in a new file in c

write a programme to compare time stamp in c

write a struct programme to keep bank details in c