Wednesday, October 2, 2019

Qbasic Program to Erase vowel from input string. (using Function procedure)

Qbasic Program to Erase vowel from input string. (using Function procedure)

DECLARE FUNCTION DISPC$ (S$)
CLS
INPUT "ENTER ANY STRING"; S$
PRINT " AFTER EARISNG 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
NEXT I
DISPC$ = D$
END FUNCTION

No comments:

Post a Comment