I need a help .. how to make a space between each column ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

I need a help .. how to make a space between each column ?

int number=1; for (int i=1; i<=7; i++) { for ( int j=1; j<=i; j++) { system.out.print(j); } system.out.println(" ")

26th Apr 2017, 3:48 AM
‏‪‏‪‏‪‏‪‏‪Lamiya‬‏‬‏‬‏‬‏‬‏
‏‪‏‪‏‪‏‪‏‪Lamiya‬‏‬‏‬‏‬‏‬‏ - avatar
3 Answers
+ 7
thanks but :( I want exactly like this 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 7
26th Apr 2017, 4:01 AM
‏‪‏‪‏‪‏‪‏‪Lamiya‬‏‬‏‬‏‬‏‬‏
‏‪‏‪‏‪‏‪‏‪Lamiya‬‏‬‏‬‏‬‏‬‏ - avatar
+ 6
i got the answer thank you so much for give me light 💡😃 int number=1; for (int i=1; i<=7; i++) { for ( int j=1; j<=i; j++) { System.out.print(" "+j); } system.out.println(" "); }
26th Apr 2017, 4:44 AM
‏‪‏‪‏‪‏‪‏‪Lamiya‬‏‬‏‬‏‬‏‬‏
‏‪‏‪‏‪‏‪‏‪Lamiya‬‏‬‏‬‏‬‏‬‏ - avatar
+ 5
try this: int number=1; for (int i=1; i<=7; i++) { for ( int j=1; j<=i; j++) { System.out.print(j+" "); } }
26th Apr 2017, 3:59 AM
Nithiwat
Nithiwat - avatar