Monday, October 11, 2021

QBASIC program to display area of a rectangle by (SUB & FUNCTION Procedure)

CLS
INPUT "Enter Length : "; l
INPUT "Enter Breadth : "; b
area=l*b
PRINT "Area = "; area
END


Using SUB Procedure

DECLARE SUB areaRectangle(l,b)
CLS
INPUT "ENTER A LENGTH ";l
INPUT "ENTER A BREADTH";b
CALL areaRectangle(l,b)
END

SUB areaRectangle(l,b)
area=l*b
PRINT "AREA IS ";area
END SUB


Using FUNCTION Procedure

DECLARE FUNCTION areaRectangle(l,b)
CLS
INPUT "ENTER A LENGTH ";l
INPUT "ENTER A BREADTH";b
a = areaRectangle(l,b)
PRINT "Area = "; a
END

FUNCTION areaRectangle(l,b)
area=l*b
areaRectangle = area
END FUNCTION

No comments:

Post a Comment

If you have any doubts, Please let me know.

[Download PDF] Computer Science Book Gread-10 in Nepali Language

 If you are searching for class 10 Computer Science in Nepali pdf for free download then you are at the right page. This book is soley publi...