Saved Bookmarks
| 1. |
Wap in java to solve the following pattern5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 |
|
Answer» Answer: PUBLIC class DownwardTrianglePattern { public static void MAIN(String[] args) { int rows=7; //inner loop for (int i= rows-1; i>=0 ; i--) { //outer loop for (int j=0; j<=i; j++) { //prints star and space System.out.PRINT("*" + " "); } //throws the cursor in the next line after printing each line System.out.println(); } } } Explanation: Hey Friend..I have made the program to print this upside down TRIANGLE in JAVA..I hope it will help you and also like the answer and mark my answer as Brainliest.. |
|