QBASIC PROGRAM TO REMOVE ALL THE VOWELS,WHITESPACES AND FULL STOPS AND PRINT THE WORD
WAP TO PRINT THE WORD CONSISTING ONLY CONSONANT LETTERS
CLS
INPUT "ENTER ANY STRING"; 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" AND C$ < > " " AND C$ < > "." THEN
W$=W$+B$
END IF
NEXT I
PRINT W$
END
USING SUB
DECLARE SUB CONSONANTS(S$)
CLS
INPUT "ENTER ANY STRING"; S$
CALL CONSONANTS(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" AND C$ < > " " AND C$ < > "." THEN
W$=W$+B$
END IF
NEXT I
PRINT W$
END SUB
0 Comments