Write a function to find factorial of a given number. The function should return the calculated factorial using return statement
Answers
Answered by
2
Answer:
# using python
def factorial_finder(number):
factorial=1
for i in range(2,number+1):
factorial*=i
return factorial
# print(factorial_finder(5))
// using javascript
function factorial_finder(number){
factorial=1
for (i=2;i<=number;i++){
factorial*=i
}
return factorial
}
// console. log(factorial_finder())
//using java
public class program{
static int factorial_finder(int number){
int factorial=1
for (i=2;i<=number;i++){
factorial*=i
}
return factorial
}
public static void main(String[] args){
System.out.print(factorial_finder(5))
}
}
Similar questions