Computer Science, asked by AYUSH12335567, 1 year ago

write a program in QBasic to calculate area and perimeter of a rectangle,circle and square.
(any one to can do)

Attachments:

Answers

Answered by ramnaresh134
54

(a) For circle =

Area of circle = pie r^2

Perimeter of circle = 2 pie r

(b) For rectangle =

Area of rectangle = length ×breadth

Perimeter = sum of all sides

(c) For square=

Area of square = side ^2

Perimeter = sum of all sides.


AYUSH12335567: all is wrong
AYUSH12335567: bad very bad fullish
Answered by aqibkincsem
71

"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

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

"


AYUSH12335567: ok
AYUSH12335567: but wrong
AYUSH12335567: nice attempt
Similar questions