0

I was working on some code to produce a 10 x 10 multiplication table with equal tabbing and spacing between rows. I can't seem to get more than one column on my table though. I did some other research but wasn't able to find a helpful answer. Any help is appreciated.

public class MultiplicationTable
{

    public static void main (String [] args)
    {

    //declare variables

    int x = 1;
    int y = 1;


    //outer loop

        for (x = 1; x <=10; x++)
        { // open the x loop

        System.out.println(x + "\n");

            for (y = 1; y <=10; y++)
            { // open the y loop

            System.out.println(x*y+"\n");


            }

            System.out.println("\n");
        }




    }
}

Edited by peter_budo: Keep It Clear - Do use code tags when posting any code

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by thines01
0

The print method is just like println, except it doesn't go onto the next line afterwards....

...or printf

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.