1
May.2018
REM THIS PROGRAMME TELLS HOW MANY TIMES A CHAR REPEATS IN A STRING
CLS
COUNT = 0
INPUT “ENTER ANY STRING”; N$
INPUT “ENTER ANY CHARACTER”; A$
L = LEN(N$)
FOR T = 1 TO L
LET S$ = MID$(N$, T, 1)
IF S$ = A$ THEN COUNT = COUNT + 1
NEXT T
PRINT “TOTAL NO OF OCCURENCE OF “; A$; ” IS”; COUNT; “times”
END
Category: Basic Programs, Computer Programs
No Comments