QBasic Programming

calculate loss percentage

REM PROGRAM TO CALCULATE LOSS PERCENTAGE
CLS
INPUT “ENTER COST PRICE”; CP
INPUT “ENTER SELLING PRICE”; SP
LP = ((CP – SP) / CP) * 100
PRINT “LOSS PERCENTAGE=”; LP
END

USING SUB PROCEDURE

DECLARE SUB LOSSP (CP, SP)
CLS
INPUT “ENTER COST PRICE”; CP
INPUT “ENTER SELLING PRICE”; SP
CALL LOSSP(CP, SP)
END

SUB LOSSP (CP, SP)
LP = ((CP – SP) / CP) * 100
PRINT “LOSS PERCENTAGE=”; LP
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION LOSSP (CP, SP)
CLS
INPUT “ENTER COST PRICE”; CP
INPUT “ENTER SELLING PRICE”; SP
PRINT “LOSS PERCENTAGE=”; LOSSP(CP, SP)
END

FUNCTION LOSSP (CP, SP)
LP = ((CP – SP) / CP) * 100
LOSS = LP
END FUNCTION

calculate profit percentage (Prev Lesson)
(Next Lesson) calculate selling price where profit percentage and cost price is given
Back to QBasic Programming
Notice: compact(): Undefined variable: limits in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

Notice: compact(): Undefined variable: groupby in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!