<html>
<head>
<title>Print a Math table</title>
<script type="text/javascript">
function math_table()
{
number = prompt("Required math table number:", "10")
var day = new Date()
var D = day.getDate()
var H = day.getHours()
var M = day.getMinutes()
var S = day.getSeconds()
document.write("Date:" + D + " Time:" + H + ":" + M + ":" + S)
document.write("<b><br><br> Math table for " + number + ":<br></b>")
for(i=1; i<=10; i++)
{
result = i * number
document.write("<br>" + number + " x " + i + " = " + result)
}
}
</script>
</head>
<body>
<input type="button" value="Generate Math Table" onclick="math_table()" />
</body>
</html>
No comments:
Post a Comment