Wednesday, October 13, 2021

QBASIC Program to print the area of 4 walls (SUB/FUNCTION Procedure Demo)

CLS
INPUT "Enter Breadth : "; b
INPUT "Enter Height : "; h
area = 2 * h * (l + b)
PRINT "Area of 4 walls = "; area
END


Using SUB Procedure

DECLARE SUB area(l,b,h)
CLS
INPUT "Enter Breadth : "; b
INPUT "Enter Height : "; h
CALL area(l, b, h)
END

SUB area (l, b, h)
     a = 2 * h * (l + b)
     PRINT "Area of 4 walls = "; a
END SUB


Using FUNCTION Procedure

DECLARE FUNCTION area(l,b,h)
CLS
INPUT "Enter Breadth : "; b
INPUT "Enter Height : "; h
a = area(l, b, h)
PRINT "Area of 4 walls = "; a
END

FUNCTION area (l, b, h)
     a = 2 * h * (l + b)
     area = a
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...