Let’s write a program that can work out the times table of any given number. The program should start by asking the user to enter a number, and we will need to store that number in a variable so we can use its value later.
writeLine("Please enter a number");
int num = readInt();
Now we’re going to need to loop from 1 to 12, printing out the value of num multiplied by 1, then num multiplied by 2, etc. That means we’re going to need another variable to store how many times we’ve been through the loop, and we’re going to have to increment that variable each time, while keeping the variable named ‘num’ the same.
Write a program that prints out the times table from 1 to 12 of any given number
What is the times table of your phone number?