please give me solution of these simple question find factorail

+1 vote
asked Feb 7 by Aakash Sharma (130 points)
/*
Complete the function below to find the factorial of a number
If you don’t know what a factorial is, please follow this link - https://en.wikipedia.org/wiki/Factorial
sample input : findFactorial(4)
output - 24
*/

let findFactorial = (x) => {
  // start your code here.
  

};

module.exports = { findFactorial: findFactorial };

2 Answers

0 votes
answered Feb 13 by BlackFlash (150 points)
#include<stdio.h>

void main()

{

int i,n,s=1;

printf("\nEnter The Number");

scanf("%d",&n);

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

{

s=s*i;

}

printf("%d!=%d",n,s);

}
0 votes
answered Feb 13 by vaisali katragadda (140 points)
#include<stdio.h>

void main()

{

int n;

printf("enter number:");

scanf("%d",&n);

int fact(int n)

{

if(n==1||n==0)

          return 1;

else if

        printf("enter non-negative  number");

else

        return n*fact(n-1);

}

printf("the factorial of %d is %d",n,fact(n));

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...