MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / pattern4

Method pattern4

Programs/patterns/Pattern4.java:11–20  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

9 // 1 2 3
10 // 1 2 3 4
11 static void pattern4(int n) {
12 for (int row = 1; row <= n; row++) {
13 // for every row, run the col
14 for (int col = 1; col <= row; col++) {
15 System.out.print(col + " ");
16 }
17 // when one row is printed, we need to add a newline
18 System.out.println();
19 }
20 }
21}

Callers 1

mainMethod · 0.95

Calls 1

printMethod · 0.80

Tested by

no test coverage detected