asked 171k views
1 vote
1)Write a Q-Basic program that takes length & breadth and find the area of rectangle.​

asked
User Creyke
by
8.7k points

1 Answer

0 votes

Answer:

CLS

INPUT "Enter the length of the rectangle: ", L

INPUT "Enter the breadth of the rectangle: ", B

A = L * B

PRINT "The area of the rectangle is "; A

END

Step-by-step explanation:

Here's a QBasic program that takes the length and breadth of a rectangle as input and calculates its area:

---------------------------------------

CLS

INPUT "Enter the length of the rectangle: ", L

INPUT "Enter the breadth of the rectangle: ", B

A = L * B

PRINT "The area of the rectangle is "; A

END

------------------------------------------

The CLS statement clears the screen before the program starts running. The INPUT statements prompt the user to enter the length and breadth of the rectangle, which are stored in variables L and B, respectively. The area of the rectangle is then calculated by multiplying L and B and stored in the variable A. Finally, the PRINT statement displays the area of the rectangle. The END statement ends the program.

answered
User Hotdin Gurning
by
8.2k points