pattern_19.java
1 /* 2 * Write code to print the following pattern 3 * 1 1 1 1 1 4 * 2 2 2 2 5 * 3 3 3 6 * 4 4 7 * 5 8 */ 9 10 public class pattern_19 { 11 public static void main(String[] args) { 12 int n = 5; 13 14 for(int i = 1; i <= n; i++) { 15 for(int j = 1; j <= (6 - i); j++) { 16 System.out.print(i + " "); 17 } 18 System.out.println(); 19 } 20 } 21 }