Using a for loop, display a right triangle of eights, with a base of 10 and a height of 10.
Example output:
8
88
888
8888
88888
888888
8888888
88888888
888888888
8888888888
Triangle of eights
- 4
Locked
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #10962697
12 September 2022, 17:29
for(int i =1; i <= 10; i++){
String hello = "8";
System.out.print(hello.repeat(i));
System.out.println("");
}
0
Siyanda Dlamini
12 March 2022, 17:06
This challenge really threw me off but I learned something new about nested loops
0
BobbyGWilly
25 January 2022, 18:47
3rd Requirement false fail. output is definitely 10 lines with 1-10 8's
0
BobbyGWilly
25 January 2022, 19:55
got this to pass instead...
+1