1. Member
Join Date
Aug 2009
Posts
50
Rep Power
0

## 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

2. Member
Join Date
Aug 2009
Posts
25
Rep Power
0
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

3. 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....

4. Senior Member
Join Date
Dec 2008
Location
Hong Kong
Posts
473
Rep Power
9
do you know for loop?
use x++ x-- to work out the program

5. Member
Join Date
Aug 2009
Posts
50
Rep Power
0
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.

6. Senior Member
Join Date
Aug 2009
Posts
2,388
Rep Power
10
First make sure you understand the difference between them then. It should be easy to spot where to put which one after that.

7. Senior Member
Join Date
Dec 2008
Location
Hong Kong
Posts
473
Rep Power
9
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)

8. 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.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•