Ask Question
21 September, 21:00

How to make a multiplication table in java

+1
Answers (1)
  1. 21 September, 23:29
    0
    Use nested loops. Here is the basic structure for one that goes up to 9. You can change the limit with user input which I assume you know how to do.

    public static void main (String[] args)

    {

    int baseNum=1;

    int multNum=1;

    int numBorder=1;

    System. out. println (" 1 2 3 4 5 6 7 8 9");

    while (baseNum<=9)

    {

    System. out. print (numBorder);

    while (multNum<=9)

    {

    System. out. print (" "+baseNum*multNum);

    multNum++;

    }

    System. out. print ("/n");

    numBorder++;

    baseNum++;

    multNum=1;

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “How to make a multiplication table in java ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers