ASDV-WebDev/Semester 1/Assignments/JavaScript/MP10_CalebFontenot/public_html/Problem 4.html

21 lines
715 B
HTML
Raw Normal View History

2023-03-22 13:47:37 -05:00
<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/html.html to edit this template
-->
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
var input = prompt("Enter a number to calculate its factorial.");
var output = 1;
for (var i = input; i > 1; i--) {
output *= i;
}
document.write("The factorial of " + input + " is " + output);
</script>
</head>
</html>