Home  |  IT Zone  |  Tips / Tricks  |  Did You Know  |  Inspirational  |  Health  |  World Infos  |  Insurance  |  Universities  |  Forex  |  Mathematics  |  Illusions  |  Children Day Quotes  |  Fun / Jokes  |  Decent Quotes  |  Birthday Msgs  |  Good Morning Msgs  |  Good Night Msg  |  Husband Wife Jokes  |  Teacher Students Jokes  |  Insult Jokes  |  Love Quotes  |  Sad Quotes  |  Funny Pics  |  Be Aware  |  Articles  |  Simple Joys of Life 

To Count Number of Vowels (SUB Procedure). (Qbasic Code)

To enter a string and count total number of vowels (using SUB Procedure). (Qbasic Code)
  • DECLARE SUB vowel(w$)
    CLS
    INPUT "Enter any word"; w$
    CALL vowel(w$)
    END

    SUB vowel (w$)
    w$ = LCASE$(w$)
    FOR i = 1 TO LEN(w$)
        c$ = MID$(w$, i, 1)
        IF c$ = "a" OR c$ = "e" OR c$ = "i" OR c$ = "o" OR c$ = "u" THEN
            n = n + 1
        END IF
    NEXT i
    PRINT "The number of vowels ="; n
    END SUB

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.