Question: Write a program that asks the user for two positive integers between 2 and 10 to use for the length and width of a rectangle.
Write a program that asks the user for two positive integers between 2 and 10 to use for the length and width of a rectangle. If the numbers are different, the larger of the two numbers should be used for the length and the smaller for the width. The program should then display a rectangle of this size on the screen using the character X. For example, if the user enters either 2 5 or 5 2, the program should display the following:
XXXXX
XXXXX
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
