Write a program in Java to display the following pattern:
12 63 7 104 8 11 135 9 12 14 15
13 Likes
public class KboatPattern { public static void main(String args[]) { for (int i = 1; i <= 5; i++) { int x = 4; System.out.print(i + " "); int t = i; for (int j = 1; j < i; j++) { t += x; System.out.print(t + " "); x--; } System.out.println(); } } }
Answered By
5 Likes