REM to check the entered character is vowel or consonant
CLS
INPUT "Enter a character:", w$
IF LCASE$(w$)="a" OR LCASE$(w$)="e" OR LCASE$(w$)="i" OR LCASE$(w$)="o" OR LCASE$(w$)="u" THEN
PRINT "The character is Vowel"
ELSE
PRINT "The character is consonant"
END IF
END
CLS
INPUT "Enter a character:", w$
IF LCASE$(w$)="a" OR LCASE$(w$)="e" OR LCASE$(w$)="i" OR LCASE$(w$)="o" OR LCASE$(w$)="u" THEN
PRINT "The character is Vowel"
ELSE
PRINT "The character is consonant"
END IF
END
This program is wrong. I wanted to see what others have done, to find that most of them are wrong. Mine is correct.
ReplyDeleteCLS
REM program to check the given letter is a vowel or consonant
Input "Enter an alphabet";L$
IF L$="A" OR L$="E" OR L$="I" OR L$="O" OR L$="U" OR L$="a" OR L$="e" OR L$="i" OR L$="o" OR L$="u" THEN
PRINT " It is a vowel"
ELSE
PRINT " It is a consonant"
END IF
END
Output:-
Enter an alphabet? A
It is a vowel
Or
Enter an alphabet? R
It is a consonant
I prepared in following way but I don't know why some terms are hidden:
DeleteREM to check the entered character is vowel or consonant
CLS
INPUT "Enter a character:", w$
IF LCASE$(w$)="a" OR LCASE$(w$)="e" OR LCASE$(w$)="i" OR LCASE$(w$)="o" OR LCASE$(w$)="u" THEN
PRINT "The character is Vowel"
ELSE
PRINT "The character is consonant"
END IF
END
or you can ....
DeleteREM to check the entered character is vowel or consonant
CLS
INPUT "Enter a character:", w$
L$=LCASE$(w$)
IF L$="a" OR L$="e" OR L$="i" OR L$="o" OR L$="u" THEN
PRINT "The character is Vowel"
ELSE
PRINT "The character is consonant"
END IF
END
can you WAP top display vowels in a text?
ReplyDeleteWould you mind to specify: Is it from a word or a sentence, just vowel letters should be displayed.
Delete