Ask Question
14 July, 21:50

How to make a multiplication table in java

+4
Answers (1)
  1. 15 July, 01:44
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers