This Java program prints a pattern of stars in the shape of a triangle. It contains two nested for loops, with the outer loop iterating 4 times for each of the 4 rows, and the inner loop printing stars from 0 to the current row number i. This prints stars in increasing number from left to right on each line to create a triangular pattern of stars.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
52 views
Star 1.java
This Java program prints a pattern of stars in the shape of a triangle. It contains two nested for loops, with the outer loop iterating 4 times for each of the 4 rows, and the inner loop printing stars from 0 to the current row number i. This prints stars in increasing number from left to right on each line to create a triangular pattern of stars.