February 16, 2017

Qbasic program to enter a word and replace the vowel letters with the consonant letters that comes after the vowel letters.

CLS
INPUT "Enter a word:  ", C$
FOR g = 1 TO LEN(C$)
K$ = UCASE$(MID$(C$, g, 1))
IF K$ = "A" THEN K$ = "B"
IF K$ = "E" THEN K$ = "F"
IF K$ = "I" THEN K$ = "J"
IF K$ = "O" THEN K$ = "P"
IF K$ = "U" THEN K$ = "V"
H$ = H$ + K$
NEXT g
PRINT "Word after changing vowel into consonant is:  ", H$
END

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.