etc.0 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 12 2 3 4 5 6 7 8 9 10 11 12
This is what I have so far
I do not know how to get my first row to only have 0-11 and not 0-12
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
etc.0 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 12 2 3 4 5 6 7 8 9 10 11 12
This is what I have so far
I do not know how to get my first row to only have 0-11 and not 0-12
Can you post what the code currently outputs
and also what you want the code to output.
If you don't understand my answer, don't ignore it, ask a question.
Currently outputs:
[code=Java]
0 1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11
2 3 4 5 6 7 8 9 10 11
3 4 5 6 7 8 9 10 11
4 5 6 7 8 9 10 11
5 6 7 8 9 10 11
6 7 8 9 10 11
7 8 9 10 11
8 9 10 11
9 10 11
10 11
11 [code]
I want this
etc.0 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 12 2 3 4 5 6 7 8 9 10 11 12 3 4 5 6 7 8 9 10 11 12 4 5 6 7 8 9 10 11 12
Is this what you want?
The first line prints 12 numbers
The second line prints some numbers, the last number is 12
the third line prints some numbers , the last number is 12
the next line prints some numbers, the last number is 12
Looks like the printing should stop for two cases. Can you see them?
If you don't understand my answer, don't ignore it, ask a question.
yeah, and no
Wait, I might have it
public static void printAdditionTable () { for (int rows=0; rows<=11; rows++){ printRow (rows); } } public static void printRow(int i) { for(int num=i;num<=12; num++) { System.out.print(num +" "); } System.out.println(); }