Javascript-Session 1-Variables

Multiplication where numbers to be multiplied, the result and output are determined by variables. Online here.

<html>
<head>
<title>Variable</title>
</head>

<body>
<h1>Multiply</h1>

<script language=”JavaScript”>

document.write(”<h2>var num and num2</h2>”);
var num = 4;
var num2 = 6;
var num3 = num * num2;

document.write(num + ” x “+ num2 + ” = ” + num3);

</script>
</body>







Leave a Reply

You must be logged in to post a comment.