FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 122   



Following program shows you how to print table for given number.
In this program we get number from user and print that number table using for loop

var input  = prompt("Enter the number:");
for (var i = 1; i <= 10; i++) {
console.log(input + " * " + i + " = " + input * i);
}

Output:

Enter the number:
3

3 * 1 = 3
3 * 2 = 6
3 * 3 = 9
3 * 4 = 12
3 * 5 = 15
3 * 6 = 18
3 * 7 = 21
3 * 8 = 24
3 * 9 = 27
3 * 10 = 30



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News