Qbasic program to find whether the supplied charcter is alphabet or not
CLS
INPUT "ENTER ANY CHARACTER"; A$
B = ASC(A$)
IF B >= 65 AND B <= 90 OR B >= 97 AND B <= 122 THEN
CK$ = "SUPPLIED CHARACTER IS ALPHABET"
ELSE
CK$ = "SUPPLIED CHARACTER IS NOT ALPHABET"
END IF
PRINT CK$
END
USING SUB
DECLARE SUB CHARACTER(A$)
CLS
INPUT "ENTER ANY CHARACTER"; A$
CALL CHARACTER(A$)
END
SUB CHARACTER(A$)
B = ASC(A$)
IF B >= 65 AND B <= 90 OR B >= 97 AND B <= 122 THEN
CK$ = "SUPPLIED CHARACTER IS ALPHABET"
ELSE
CK$ = "SUPPLIED CHARACTER IS NOT ALPHABET"
END IF
PRINT CK$
END SUB
0 Comments