Computer Science, asked by baidurjyobanerjee, 4 months ago

FIND THE QBASIC PROGRAM TO FIND PERIMETER OF SQUARE ?​

Answers

Answered by garvsain
2

Answer:

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

Explanation:

please mark me branlist

Answered by BanGDreamLover
5

Answer:

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

17. Display area of circle.

REM PROGRAM TO DISPLAY AREA OF CIRCLE

CLS

INPUT “ENTER RADIUS”; R

A = 3.14 * R ^ 2

PRINT “AREA OF CIRCLE ”; A

END

USING SUB PROCEDURE

DECLARE SUB AREA (R)

CLS

INPUT “ENTER RADIUS”; R

CALL AREA(R)

END

SUB AREA (R)

A = 3.14 * R ^ 2

PRINT “AREA OF CIRCLE ”; A

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION AREA (R)

CLS

INPUT “ENTER RADIUS”; R

AR = AREA(R)

PRINT “AREA OF CIRCLE ”; AR

END

FUNCTION AREA (L, B)

A = 3.14 * R ^ 2

AREA = A

END FUNCTION

18. Display perimeter of rectangle.

REM PROGRAM TO DISPLAY PERIMETER OF RECTANGLE

CLS

INPUT “ENTER LENGTH”; L

INPUT “ENTER BREADTH”; B

P = 2 * (L + B)

PRINT “PERIMETER OF RECTANGLE ”; P

END

USING SUB PROCEDURE

DECLARE SUB PERIMETER (L, B)

CLS

INPUT “ENTER LENGTH”; L

INPUT “ENTER BREADTH”; B

CALL PERIMETER(L, B)

END

SUB PERIMETER (L, B)

P = 2 * (L + B)

PRINT “PERIMETER OF RECTANGLE ”; P

END SUB

Similar questions