Wednesday, October 16, 2019

13. Qbasic Program to calculate profit.


13.      Using FUNCTION……END FUNCTION, write a program to input cost price and selling price from the keyboard to calculate profit.

DECLARE FUNCTION PROFIT (CP, SP)
CLS
INPUT “ENTER COST PRICE”; CP
INPUT “ENTER SELLING PRICE”; SP
PRINT “PROFIT AMOUNT=”; PROFIT (CP, SP)
END

FUNCTION PROFIT (CP, SP)
P = SP – CP
PROFIT = P
END FUNCTION

No comments:

Post a Comment