QBasic Programming

Input a mark in a subject of a student and check if the student is pass or nor. [Pass Mark >=40]

REM
CLS
INPUT “ENTER MARKS”; M
IF M >= 40 THEN
PRINT “YOU ARE PASS”
ELSE
PRINT “ YOU ARE FAIL”
END IF
END

USING SUB PROCEDURE
DECLARE SUB CHECK (M)
CLS
INPUT “ENTER MARKS”; M
CALL CHECK (M)
END
SUB CHECK (N)
IF M >= 40 THEN
PRINT “YOU ARE PASS”
ELSE
PRINT “ YOU ARE FAIL”
END IF
END SUB
USING FUNCTION PROCEDURE
DECLARE FUNCTION CHECK$ (M)
CLS
INPUT “ENTER MARKS”; M
PRINT “YOU ARE “;CHECK$(M)
END

FUNCTION CHECK$ (M)
IF M >= 40 THEN
CHECK$ =“PASS”
ELSE
CHECK$ = “FAIL”
END IF
END FUNCTION

WAP to input any number and check whether the given no. is positive or negative (Prev Lesson)
(Next Lesson) Input the age of a person and find out whether the person is eligible to drive or not. [age >=16]
Back to QBasic Programming

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!