Count total no. of words in a sentence

DECLARE FUNCTION COUNT(A$)
CLS
INPUT"ENTER A SENTENCE";A$
PRINT"TOTAL NO. OF WORDS=";COUNTA$
END

FUNCTION COUNT(A$)
C = 1
FOR I= 1 TO LEN (A$)
B$ =MID$(A$,I,1)
C$=UCASE$(B$)
IF C$=" " THEN C=C+1
NEXT I
COUNT=C
END FUNCTION

Comments

Popular posts from this blog

My experience in jagat mandir school

PERFECT SQR OR NOT

Picnic experience