Search This Blog

Wikipedia

Search results

Monday, September 30, 2019

QBasic program to count total no of word in a sentence. FUNCTION

DECLARE FUNCTION COUNT(S$)
CLS 
INPUT"ENTER ANY STRING"S$
PRINT"TOTAL NO OF WORD =";COUNT(S$)
END

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

No comments:

               Journey of Jagat Mandir H. S. School When I was at the age of three I joined the school in the village. When I came to K...