Computer Science, asked by shabirs2159, 1 year ago

Write a program in qbasic to find the area and perimeter of a rectangle whose length is 10m and width is 5m.Write a program to do calculation

Answers

Answered by Anonymous
45

15. Display area of rectangle.


REM PROGRAM TO DISPLAY AREA OF RECTANGLE

CLS

INPUT “ENTER LENGTH”; L

INPUT “ENTER BREADTH”; B

A = L * B

PRINT “AREA OF RECTANGLE ”; A

END


USING SUB PROCEDURE


DECLARE SUB AREA (L, B)

CLS

INPUT “ENTER LENGTH”; L

INPUT “ENTER BREADTH”; B

CALL AREA(L, B)

END


SUB AREA (L, B)

A = L * B

PRINT “AREA OF RECTANGLE ”; A

END SUB


USING FUNCTION PROCEDURE


DECLARE FUNCTION AREA (L, B)

CLS

INPUT “ENTER LENGTH”; L

INPUT “ENTER BREADTH”; B

AR = AREA(L, B)

PRINT “AREA OF RECTANGLE ”; AR

END


FUNCTION AREA (L, B)

A = L * B

AREA = A

END FUNCTION


16. Display area of square.


REM PROGRAM TO DISPLAY AREA OF SQUARE

CLS

INPUT “ENTER LENGTH”; L

A = L ^ 2

PRINT “AREA OF SQUARE ”; A

END


USING SUB PROCEDURE


DECLARE SUB AREA (L)

CLS

INPUT “ENTER LENGTH”; L

CALL AREA(L)

END


SUB AREA (L)

A = L ^ 2

PRINT “AREA OF SQUARE”; A

END SUB


USING FUNCTION PROCEDURE


DECLARE FUNCTION AREA (L)

CLS

INPUT “ENTER LENGTH”; L

AR = AREA(L)

PRINT “AREA OF SQUARE ”; AR

END


FUNCTION AREA (L)

A = L ^ 2

AREA = A

END FUNCTION


I hope this will help you

If not then comment me

Answered by RiddhimaMore23
23

Answer:

Rem AREA OF RECTANGLE

CLS

INPUT "LENGTH ";L

INPUT "WIDHT"; B

A= L * B

PRINT " AREA PF RECTANGLE "; A

END

Explanation:

HOPE THIS HELPS YOU

PLEASE

MARK ME BRAINLIEST

Similar questions