belongs to collection: Java Pattern programs
1 2 3 4 51 2 3 41 2 31 21
public class pattern { public static void main(String[] args) { int i ,j; int n = 5; for(i = n; i>0 ; i-- ) { for(j = 1; j<=i ; j++) { System.out.print(j); } System.out.println(""); } } }
Output:
1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
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: