Monday, May 8, 2017

QBASIC PROGRAM to display count frequency of each letter in word as letter given in word.

QBASIC PROGRAM to display count frequency of each letter in word  as letter given in word. 
 For example if my input word is:bbinood then output should be :b2i1n1o2d1
CLS
INPUT "ENTER A WORD"; W$
W$ = LCASE$(W$)
T$ = ""
C = 0
DO
    D$ = MID$(W$, 1, 1)
    FOR I = 1 TO LEN(W$)
        IF D$ = MID$(W$, I, 1) THEN
            C = C + 1
        ELSE
            T$ = T$ + MID$(W$, I, 1)
        END IF
    NEXT I
    PRINT D$; "="; C
    C = 0
    W$ = T$
    T$ = ""
LOOP UNTIL LEN(W$) = 0
END


Solved By: Sarika Shrestha


2 comments:

  1. Thanks Sarika Shrestha and Deepak Shrestha Teacher

    ReplyDelete
  2. unit 2,3,4,5,6,7 and 8 ,9 , 20 post garnu sir ji

    ReplyDelete