2) PRINT Total numbers of vowels in a given word(sub)

by - October 03, 2019

DECLARE SUB COUNT (A$)
CLS
INPUT "Enter a word" ; A$
CALL COUNT (A$)
END

SUB COUNT (A$)

C = 0
FOR I = 1 TO LEN(A$)
B$ = MID$ (A$, I, 1)
C$ = UCASE$ (B$)
IF C$< > "A" OR C$< > "E" OR C$ < > "I" OR C$< >"O" OR C$ < > "U"  THEN C = C + 1
NEXT I
PRINT  " Total no. of vowels =" C
END FUNCTION

You May Also Like

0 comments