Wednesday, October 13, 2021

QBASIC Program to display simple interest (SUB/FUNCTION Procedure)

CLS
PRINT "Enter the following... "
INPUT "Principle : "; p
INPUT "Time : "; t
INPUT "Rate : "; r
i = (p * t * r) / 100
PRINT "Simple Interest (I) = "; i
END


Calculate Simple Interest Using SUB Procedure

DECLARE SUB interest(p,t,r)
CLS
PRINT "Enter the following... "
INPUT "Principle : "; p
INPUT "Time : "; t
INPUT "Rate : "; r
CALL interest(p, t, r)
END

SUB interest (p, t, r)
     i = (p * t * r) / 100
     PRINT "Simple Interest (I) = "; i
END SUB


Calculate Simple Interest Using FUNCTION Procedure

DECLARE FUNCTION interest(p,t,r)
CLS
PRINT "Enter the following... "
INPUT "Principle : "; p
INPUT "Time : "; t
INPUT "Rate : "; r
i = interest(p, t, r)
PRINT "Simple Interest (I) = "; i
END

FUNCTION interest (p, t, r)
     i = (p * t * r) / 100
     interest = i
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...