0
How do you center a pyramid figure in Javascript
Hello I have to print this statement (Seen below), and my code is correct in doing it BUT I can not get it to center directly down the middle! 1 212 32123 4321234 543212345 ---------------------------------------------------------My Code: public class pyramid { public static void main(String []args){ for(int i=1; i<=7 ; i++) { for(int j=i; j>=2; j--) { System.out.print(j); } for(int j=1; j<=i; j++) { System.out.print(j); } System.out.println(" "); } } }
1 Resposta
0
Heres what my program printsvexactly as so:
1
212
32123
4321234
543212345
65432123456
7654321234567