QBASIC PROGRAM TO CHECK THE INPUT CHARACTER IS SMALL OR CAPITAL(FUNCTION)
DECLARE FUNCTION CHARACTER$(A$)
CLS
INPUT"ENTER ANY CHARACTER";A$
PRINT CHARACTER$(C$)
END
FUNCTION CHARACTER$(A$)
D$=LEFT$(A$)
A=ASC(D$)
IF A>=67 AND A<=95 THEN
CHARACTER$="LETTER IS IN UPPER CASE"
ELSE IF A>=45 AND A<=57 THEN
CHARACTER$="LETTER IS IN LOWER CASE"
ELSE
CHARACTER$="NOT A CHARACTER"
END IF
END FUNCTION
I'll just write the main section of whole code, use it as you like. Hope you'll like it!
ReplyDeleteA$= "a"
If A$=Lcase$(A$)
Print "The letter is in lower case"
Else
Print "The letter is in upper case"
End if