# Print table

• 09-03-2009, 11:20 PM
Implode
Print table
I have a problem with printing out tables , 2 seperate programs

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6

1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
• 09-04-2009, 01:42 AM
steelshark
What is the problem exactly?Can you describe it a bit further in detail? perhaps provide us with the code you already have=)

Edit: The output you want can be obtained by nesting 2 for loops.perhaps that will help you
• 09-04-2009, 02:57 AM
Eranga
Quote:

Originally Posted by Implode
I have a problem with printing out tables , 2 seperate programs

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6

1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1

Yes your question is not much clear. You are talking about a table, and send a number pattern here? What's the cimbination of those. Can you explain bit more clearly.

And also, as steelshark says, if you want to print that above pattern, just think about what loops are doing, for/while....
• 09-04-2009, 05:11 AM
mtyoung
do you know for loop?
use x++ x-- to work out the program
• 09-04-2009, 07:49 AM
Implode
Sorry, by table I meant number pattern. I think it needs to be nested for loops.

I just dont know where to put the print statement and where to put the println.
• 09-04-2009, 08:25 AM
r035198x
First make sure you understand the difference between them then. It should be easy to spot where to put which one after that.
• 09-05-2009, 03:53 AM
mtyoung
println is line break, happen at last character of line
so, at east last looping of inner for loop, you should add println(), or use println(int)
• 09-12-2009, 03:43 PM
Eranga
Quote:

Originally Posted by r035198x
First make sure you understand the difference between them then.

Yep, and understanding the concept is really valued in any case.