Question:

Write a program that compares the area of two rectangles. The program prompts the user for the height and width of both rectangl

Write a program that compares the area of two rectangles. The
program prompts the user for the height and width of both
rectangles. You can assume the data type for height and width
are int. The program will compare the area of both rectangles
and use the if statement to decide if they have the same area,
or one is larger than the other as described below:
Both have the same area, it will print "Both rectangles
have the same area."
O
First has larger area, it will print "The first rectangle
has larger area.”
Second has larger area, it will print "The second rectangle
has larger area."
This program compares area of rectangles.
Enter height of rectangle 1: 5
Enter width of rectangle i : 2
Enter height of rectangle 2: 10
Enter width of rectangle 2 : 5
The second rectangle has larger area.

Write a program that compares the area of two rectangles. The program prompts the user for the height and width of both rectangles. You can assume the data type for height and width are int. The program will compare the area of both rectangles and use the if statement to decide if they have the same area, or one is larger than the other as described below: Both have the same area, it will print "Both rectangles have the same area." O First has larger area, it will print "The first rectangle has larger area.” Second has larger area, it will print "The second rectangle has larger area." This program compares area of rectangles. Enter height of rectangle 1: 5 Enter width of rectangle i : 2 Enter height of rectangle 2: 10 Enter width of rectangle 2 : 5 The second rectangle has larger area.