var number=prompt("Enter a number",""), i=1, result;
while(i<number) {
result=number*(--number);
}
console.log(result);
var number=prompt("Enter a number",""), i=1, result=1;
while(i<=number) {
result = result * (i++);
}
console.log(result);
var number=prompt("Enter a number",""), result=1;
while(number) {
result *= number--;
}
console.log(result);