QBasic Programming

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

Display sum of cube of any three input numbers (Prev Lesson)
(Next Lesson) Display area of square
Back to QBasic Programming

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!