Find Factorial Value from Input Number

Source:

var n;
function calculatefactorial(n){
	if(n==0){
		return 1;
		}else{
			return n*calculatefactorial(n-1);
		}
		}
var number=prompt("Enter a Numver: ","1");
alert(calculatefactorial(number));
document.writeln("Factorial of Your input ("+number+") "+"is: "+calculatefactorial(number));

Download Complete Source Code

2 thoughts on “Find Factorial Value from Input Number

Leave a Reply