Example:
<body>
<script>
t=9;
i=1;
while(i<=12)
{
document.write("<br/>" + t+ " X " + i + " = " + i*t);
i++;
}
</script>
</body>
Output:
9 X 1 = 9
9 X 2 = 18
9 X 3 = 27
9 X 4 = 36
9 X 5 = 45
9 X 6 = 54
9 X 7 = 63
9 X 8 = 72
9 X 9 = 81
9 X 10 = 90
9 X 11 = 99
9 X 12 = 108
<body>
<script>
t=9;
i=1;
while(i<=12)
{
document.write("<br/>" + t+ " X " + i + " = " + i*t);
i++;
}
</script>
</body>
Output:
9 X 1 = 9
9 X 2 = 18
9 X 3 = 27
9 X 4 = 36
9 X 5 = 45
9 X 6 = 54
9 X 7 = 63
9 X 8 = 72
9 X 9 = 81
9 X 10 = 90
9 X 11 = 99
9 X 12 = 108
No comments:
Post a Comment