Qbasic Program to print a sentence in title case.  

Posted by Mahibabu

REM Program to print the given sentence into titlecase
CLS
INPUT "Enter a sentence"; s$
b$ = UCASE$(MID$(s$, 1, 1))
w$ = w$ + b$
FOR i = 2 TO LEN(s$)
IF RIGHT$(w$, 1) = " " THEN
b$ = UCASE$(MID$(s$, i, 1))
ELSEb$ = LCASE$(MID$(s$, i, 1))
END IF
w$ = w$ + b$
NEXT i
PRINT w$
END

1 comments

Will this program work for title case ? I don't think so

Post a Comment

Contributors

My photo
I am Mahesh Bhandari from Kathmandu, Nepal

Check Nepal's Time