Also I think you need two (for) loops .....one to control the rows and the second to control the columns in which the character or white space is printed.
Reacting to user input will require more code. I made the statement to liuiustrate that a rectangle does not need a loop to create it. Creating a flexible one whose size is not known until run time will require calculations and probably a loop.
Comment