Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
please give me solution of these simple question find factorail
+1
vote
asked
Feb 7, 2020
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 };
Please
log in
or register to answer this question.
2 Answers
0
votes
answered
Feb 13, 2020
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);
}
Please
log in
or register to add a comment.
0
votes
answered
Feb 13, 2020
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));
}
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...