write a program factorial in c
Answers
Answered by
1
Explanation:
#include<stdio.h>
int main()
{
int i,fact=1,number;
printf("Enter a number: ");
scanf("%d",&number);
for(i=1;i<=number;i++){
fact=fact*i;
FOLLOW ME
MARK AS BRAINLIST
Answered by
1
Answer:
- long factorial(int);
- int main() { int n;
- printf("Enter a number to calculate its factorial\n"); scanf("%d", &n);
- printf("%d! = %ld\n", n, factorial(n));
- return 0; }
- long factorial(int n) { int c; long r = 1;
- for (c = 1; c <= n; c++) r = r * c;
- return r; }
PLEASE MARK IT AS BRAINLIEST AND FOLLOW ME.
Similar questions