' IF/ELSEIF/ELSE — Conditional branching
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL score AS LONG

    INPUT "Enter test score (0-100): ", score
    PRINT

    IF score >= 90 THEN
        PRINT "Grade: A"
    ELSEIF score >= 80 THEN
        PRINT "Grade: B"
    ELSEIF score >= 70 THEN
        PRINT "Grade: C"
    ELSEIF score >= 60 THEN
        PRINT "Grade: D"
    ELSE
        PRINT "Grade: F"
    END IF

    IF score >= 0 AND score <= 100 THEN
        PRINT "Valid score."
    ELSE
        PRINT "Invalid score!"
    END IF

    FUNCTION = 0
END FUNCTION
