Computer Science, asked by mmm1527, 5 months ago

write a program in Q basic to find the perimeter of a rectangle​

Answers

Answered by aditya876881
2

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

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

USING SUB PROCEDURE

DECLARE SUB CIRCUM (R)

CLS

INPUT “ENTER RADIUS”; R

CALL CIRCUM (R)

END

SUB CIRCUM (R)

C = 2 * 3.14 * R

PRINT “CIRCUMFERENCE OF CIRCLE ”; C

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION CIRCUM (R)

CLS

INPUT “ENTER RADIUS”; R

CR = CIRCUM(R)

PRINT “CIRCUMFERENCE OF CIRCLE ”; CR

END

FUNCTION CIRCUMFERENCE (L, B)

C = 2 * 3.14 * R

CIRCUM = C

END FUNCTION

21.

SUB CIRCUM (R)

C = 2 * 3.14 * R

PRINT “CIRCUMFERENCE OF CIRCLE”; C

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION AREA (R)

DECLARE FUNCTION CIRCUM (R)

CLS

INPUT “ENTER RADIUS”; R

PRINT “AREA OF SQUARE ”; AREA(R)

PRINT “CIRCLE OF CIRCUMFERENCE”; CIRCUM (R)

END

FUNCTION AREA (R)

AREA = 3.14 * R ^ 2

END FUNCTION

FUNCTION CIRCUM (R)

CIRCUM = 2 * 3.14 * R

END FUNCTIONE

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

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

USING FUNCTION PROCEDURE

DECLARE FUNCTION PERIMETER (L, B)

CLS

INPUT “ENTER LENGTH”; L

INPUT “ENTER BREADTH”; B

PR = PERIMETER(L, B)

PRINT “PERIMETER OF RECTANGLE ”; PR

END

FUNCTION PERIMETER (L, B)

P = 2 * (L + B)

PERIMETER = P

END FUNCTION

19. Display perimeter of square.

REM PROGRAM TO DISPLAY PERIMETER OF SQUARE

CLS

INPUT “ENTER LENGTH”; L

P = 4 * L

PRINT “PERIMETER OF SQUARE ”; P

END

USING SUB PROCEDURE

DECLARE SUB PERIMETER (L)

CLS

INPUT “ENTER LENGTH”; L

CALL PERIMETER (L)

END

SUB PERIMETER (L)

P = 4 * L

PRINT “PERIMETER OF SQUARE”; P

END SUB

USING FUNCTION PROCEDURE

FUNCTION AREA (L, B)

A = L * B

AREA = A

END FUNCTION

FUNCTION PERIMETER (L, B)

P = 2 * (L + B)

PERIMETER = P

END FUNCTION

SUB AREA (R)

A= 3.14 * R ^ 2

PRINT “AREA OF CIRCLE”; A

END SUB

SUB CIRCUM (R)

C = 2 * 3.14 * R

PRINT “CIRCUMFERENCE OF CIRCLE”; C

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION AREA (R)

DECLARE FUNCTION CIRCUM (R)

CLS

INPUT “ENTER RADIUS”; R

PRINT “AREA OF SQUARE ”; AREA(R)

PRINT “CIRCLE OF CIRCUMFERENCE”; CIRCUM (R)

END

FUNCTION AREA (R)

AREA = 3.14 * R ^ 2

END FUNCTION

FUNCTION CIRCUM (R)

CIRCUM = 2 * 3.14 * R

END FUNCTION

pls chek it on google as brainly says no answer more than 5000 words so i skip some step

pls mark me as brainest as it is difficult to type such long

Similar questions