QBASIC PROGRAM TO ERASE VOWEL FROM INPUT STRING USING FUNCTION.


DECLARE FUNCTION DISPC$(S$)
CLS
INPUT"ENTER ANY STRING";S$
PRINT"AFTER ERASING VOWELS=";DISPC$(S$)
END

FUNCTION DISPC$(S$)
FOR I=1 TO LEN(S$)
B$=MID$(S$,I,1)
C$=UCASE$(B$)
IF C$<>"A" AND C$<>"E" AND C$<>"I" AND C$<>"O" AND C$<>"U" THEN
D$=D$+B$
END IF
DISP C$=D$
END FUNCTION

Comments

Popular Posts