Computer Science, asked by Lesyeuxdeninii, 2 months ago

Write a QBASIC program to input length and breadth of a rectangle, calculate area and display on screen.

Answers

Answered by anindyaadhikari13
11

Solution:

The given c‎ode is written in QBASIC.

CLS

INPUT "Enter length: "; L

INPUT "Enter breadth: "; B

AREA = L * B

PRINT "Area is:"; AREA

END

Explanation:

  • Line 1: Clear the screen.
  • Line 2 and 3: Take length and breadth as input from the user.
  • Line 4: Calculate area using formula.
  • Line 5: Display the of the rectangle.
  • Line 6: End the program.

See the attachment for output.

Attachments:
Answered by BrainlyProgrammer
6

Answer:

CLS

INPUT "ENTER LENGTH AND BREADTH";L,B

AREA=L*B

PRINT "AREA";AREA

END

Logic:-

  • Accept length and breadth as input
  • calculate area
  • display area
Similar questions