Write a program in Java to display the following pattern:
12345 23456 34567 45678 56789
10 Likes
public class KboatPattern { public static void main(String args[]) { for (int i = 1; i <= 5; i++) { int x = i; for (int j = 1; j <= 5; j++) { System.out.print(x); x++; } System.out.println(); } } }
Answered By
3 Likes