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

Method pattern3

Programs/patterns/Pattern3.java:12–21  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

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

Callers 1

mainMethod · 0.95

Calls 1

printMethod · 0.80

Tested by

no test coverage detected