Ask Question
20 January, 08:58

How to make a multiplication table in java

+4
Answers (1)
  1. 20 January, 09:18
    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?
Find an answer to your question 👍 “How to make a multiplication table in java ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers