HomeExam Question Papers - (Class-10, Class-9, Class-8, Class-7, Class-6, Class-5, Class-4Class-3Class-2Class-1, Class-S.K.G., Class-J.K.G., Class-Nursery)

A Program to input a word and count total number of alphabet 'A' in the input word.


 A Program to input a word and count total number of alphabet 'A' in the input word. (Qbasic Code)



CLS

INPUT "Enter a word"; w$

w$ = UCASE$(w$)

x = LEN(w$)

FOR i = 1 TO x

    x$ = MID$(w$, i, 1)

    IF x$ = "A" THEN

        c = c + 1

    ELSE

    END IF

NEXT i

PRINT "The total number of A is"; c

END

Share :

Facebook x
Back To Top

facebook

Powered by Blogger.