Ask your own question, for FREE!
Computer Science 10 Online
OpenStudy (anonymous):

generate a single digit number that represents number of lines two display and write a program in java to generate following pattern 1 121 12321 1234321 123454321

OpenStudy (anonymous):

Google "java for loop pyramid"

OpenStudy (anonymous):

public static void main(String[] args) { int x = 5; // this is the number of lines for (int i = 1; i <= x; i++) { for (int j = 1; j <= x - i; j++) { System.out.print(" "); } for (int k = 1; k <= i; k++) { System.out.print(k); } if (i >= 2) { for (int l = 1; l <= i - 1; l++) { System.out.print(i - l); } } System.out.print("\n"); } }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!