How to count frequecy of each letter of word in qbasic? : Successfully counted each letter but letter order can't display sequentially as in word.
For example- Input word-bbinood 
             Output=b2i1n1o2d1

Here my program in qbasic:
INPUT "Enter the string:", A$
n = LEN(A$)

FOR i = 97 TO 122

    FOR j = 1 TO n
        IF CHR$(i) = MID$(A$, j, 1) THEN
            count = count + 1
        END IF
    NEXT
    FOR j = 1 TO n
        IF (MID$(A$, j, 1) = CHR$(i)) THEN
            PRINT CHR$(i), count
            j = n
        END IF

    NEXT

    count = 0
NEXT





