Question: The nested loops for (int i = 1; i

The nested loops

for (int i = 1; i <= height; i++)
{
for (int j = 1; j <= width; j++) { System.out.print("*"); }
System.out.println();
}
display a rectangle of a given width and height, such as
****
****
****
Write a single for loop that displays the same rectangle.

Step by Step Solution

3.52 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

2106_61d6ac34639ff_872309.pdf

180 KBs PDF File

Word file Icon

2106_61d6ac34639ff_872309.docx

120 KBs Word File

Students Have Also Explored These Related Java Concepts Late Objects Questions!