58.5k views
3 votes
Write a program to find area of rectangle​

2 Answers

5 votes

Answer:

program by INPUT statement

Step-by-step explanation:

CLS

REM to find the area of rectangle

INPUT L

INPUT B

LET AOR = L * B

LET " AOR = "; AOR

END

Press F5

User FreeJack
by
6.2k points
1 vote

Area of Rectangle - Python

Assuming that the question needs Python program to find the area of a rectangle. Since we are not given in the Question only by which programming language we write the required program, therefore here we use python program.

Before we write the required program for this question, let's first take some hint for better understanding and know that what we need to do in this program.

Let us take a look at what we need to do in this program.

We know that, the area of rectangle is defined as the product of its length and breadth respectively.

→ Area of rectangle = length * breadth

First we would take user input to accept the values of length and breadth of the rectangle from the user.

We then calculate the area of the rectangle using the required formula of it.

The Program

# Program to find the area of rectangle

# Take user input to accept length

length = float(input("Enter the measure of length: "))

# Take input to accept breadth

breadth = float(input("Enter the measure of breadth: "))

# Calculate the area of rectangle using the formula

area = length * breadth

# Assign the result

print("The area of rectangle is", area, "square units.")

[Hashtag (#) is only a single line comment in Python, It's not printed in the program, I have used them here for understanding the program step-by-step. If you want then you can remove those comments from the program.]

The Output

Enter the measure of length: 5

Enter the measure of breadth: 10

The area of rectangle is 50.0 square units.

User Ivan Gerasimenko
by
6.2k points