oops check this
for (int i=0; i < sentencelength; i++){
if (sentence.charAt(i) == ' '){
if (lettercount >= limit){
finalcount ++;
}
...
Type: Posts; User: Aju_21
oops check this
for (int i=0; i < sentencelength; i++){
if (sentence.charAt(i) == ' '){
if (lettercount >= limit){
finalcount ++;
}
...
The problem with ur code is it uses " " (space) to increment the finalcount . There is no space after last word, so it doesn;t gets count. Try appending a space to the string after u take as input or...