We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d60f3ce commit e70e6beCopy full SHA for e70e6be
Pattern-1/Reverse_Number_Pattern.java
@@ -0,0 +1,33 @@
1
+/*
2
+Print the following pattern for the given N number of rows.
3
+Pattern for N = 4
4
+1
5
+21
6
+321
7
+4321
8
+*/
9
+
10
+import java.util.*;
11
12
+public class Reverse_Number_Pattern {
13
+ public static void main(String[] args) {
14
15
+ /* Your class should be named Solution.
16
+ * Read input as specified in the question.
17
+ * Print output as specified in the question.
18
+ */
19
+ Scanner sc= new Scanner(System.in);
20
+ int N = sc.nextInt();
21
+ int m;
22
+ for(int i=1;i<=N;i++)
23
+ {
24
+ m=i;
25
+ for(int j=0;j<i;j++)
26
27
+ System.out.print(m);
28
+ m--;
29
+ }
30
+ System.out.println("");
31
32
33
+}
0 commit comments