Wednesday, October 16, 2019

51. Qbasic program to find out whether the person is eligible to drive or not


51.      Input the age of a person and find out whether the person is eligible to drive or not using function procedure. [age >=16]

DECLARE FUNCTION CHECK$ (A)
CLS
INPUT “ENTER YOUR AGE”; A
PRINT “YOU ARE “; CHECK$(A)
END
FUNCTION CHECK$ (A)
IF A >= 16 THEN
CHECK$ = “ELIGIBLE TO DRIVE”
ELSE
CHECK$ = “ NOT ELIGIBLE TO DRIVE”
END IF
END FUNCTION

No comments:

Post a Comment