Count total no of vowel in a given word using function procedure.
DECLARE FUNCTION COUNT(N$)
CLS
INPUT"ENTER ANY WORDS";N$
PRINT"TOTAL NO OF VOWEL=";COUNT(N$)
END
FUNCTION COUNT(N$)
C=0
FOR I=1TO LEN(N$)
BS
$=MID$(N$,I,1)
C$=UCASE$(B$)
IFC$="A"ORC$="E"ORC$="O"ORC$="U"THEN C=C+1
NEXT I
COUNT=C
END FUNCTION
DECLARE FUNCTION COUNT(N$)
CLS
INPUT"ENTER ANY WORDS";N$
PRINT"TOTAL NO OF VOWEL=";COUNT(N$)
END
FUNCTION COUNT(N$)
C=0
FOR I=1TO LEN(N$)
BS
$=MID$(N$,I,1)
C$=UCASE$(B$)
IFC$="A"ORC$="E"ORC$="O"ORC$="U"THEN C=C+1
NEXT I
COUNT=C
END FUNCTION
Comments
Post a Comment