323,745 views
14 votes
14 votes
PLEAS help me with the number triangle

PLEAS help me with the number triangle-example-1
User Imran Saeed
by
3.2k points

1 Answer

27 votes
27 votes

Answer:

public static void makeNumberTriangle() {

for(int i=1; i<=5; i++) {

for(int j=1; j<=i; j++) {

System.out.printf("%d ",j);

}

System.out.println();

}

}

Step-by-step explanation:

You were very close!

User Edwise
by
3.0k points