belongs to collection: Java Pattern programs
11 21 2 31 2 3 41 2 3 4 5
public class pattern4 { public static void main(String[] args) { int n = 5; for(int i = 0 ; i <= n ; i++) { for(int j = 0 ; j < i ; j++) { System.out.print(j+1); } System.out.println(""); } } }
Output:
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Program:
Output: