Output:
Click Here For Java Online Compiler
Solution:
1 2 3 4 5 2 3 4 5 3 4 5 4 5 5 4 5 3 4 5 2 3 4 5 1 2 3 4 5
Click Here For Java Online Compiler
Solution:
class NumberPattern12 { public static void main(String[] args) { int rows = 5; for (int i = 1; i <= rows; i++) { for (int j = 1; j < i; j++) { System.out.print(" "); } for (int j = i; j <= rows; j++) { System.out.print(j + " "); } System.out.println(); } for (int i = rows - 1; i >= 1; i--) { for (int j = 1; j < i; j++) { System.out.print(" "); } for (int j = i; j <= rows; j++) { System.out.print(j + " "); } System.out.println(); } } }
comment 1 comments:
more_vertgood article.thank you for sharing useful info.
29 August 2018 at 20:13visit
web programming tutorial
welookups
sentiment_satisfied Emoticon