CS 200 - Lab 10

Draw a rectangle

Write a program to prompt the user for two integers representing a number of rows and number of columns.  Then, print rows of asterisk ("*") characters forming a rectangle of the size requested by the user.

Example run (user input in bold red):

Number of rows: 5
Number of columns: 25

Getting started

If you have a solution open in Visual Studio, close it (File->Close Solution).

Download lab10.zip.  Import it into Visual Studio (File->Import...).

Add your code to the source file called Rectangle.c.


Use a nested pair of loops.  The outer loop generates all of the rows of the rectangle.  The inner loop generates a single row of the rectangle.