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.
2 parents 84e7c1b + b6b2470 commit c3ba10fCopy full SHA for c3ba10f
pattern2.java
@@ -0,0 +1,30 @@
1
+// Java Program to print pattern
2
+// Number-increasing pyramid
3
+import java.util.*;
4
+
5
+public class GeeksForGeeks {
6
+ // Function to demonstrate pattern
7
+ public static void printPattern(int n)
8
+ {
9
+ int i, j;
10
+ // outer loop to handle number of rows
11
+ for (i = 1; i <= n; i++) {
12
+ // inner loop to handle number of columns
13
+ for (j = 1; j <= i; j++) {
14
+ // printing column values upto the row
15
+ // value.
16
+ System.out.print(j + " ");
17
+ }
18
19
+ // print new line for each row
20
+ System.out.println();
21
22
23
24
+ // Driver Function
25
+ public static void main(String args[])
26
27
+ int n = 6;
28
+ printPattern(n);
29
30
+}
0 commit comments