Math, asked by faithyetty7267, 1 year ago

Write an algorithm to calculate the factorial of a given number

Answers

Answered by Sid441
3

If you mean in c programming,

#include<stdio.h>

#include<conio.h>

int main()

{

int n,i,fact=1;

printf("Enter any number : ");

scanf("%d", &n);

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

fact = fact * i;

printf("Factorial value of %d = %d",n,fact);

return 0;

}

Similar questions