Program to print table
In this section, you will learn how you can easily print table like : "5", "10", "12", "25", "100" and more. In this example, we print table of 5 using javascript.
Let's try to create a simple program :
➤ Code : JavaScript program to print table for a given number;
<script>
//Enter your number here, as often as you want to print table.
var number = 5;
for(let i = 1; i<=10; i++) {
let table = number * i;
console.log(number+"*"+i+"= "+table);
}
<script>
Comments