Computer Science, asked by snehil7549, 1 year ago

Write a program to input a sentence and convert it into uppercase and print total number of consecutive letters without using array.

Answers

Answered by Anonymous
0

Approach:Here we have to find out number of words in a sentence and the corresponding character count of each word.

Here first we create an equivalent char array of given String.

Now we iterate the char array using for loop. Inside for loop we declare a String with empty implementation.

Whenever we found an alphabet we will perform concatination of that alphabet with the String variable and increment the value of i.

Now when i reaches to a space it will come out from the while loop and now String variable has the word which is previous of space.

Now we will print the String variable with the length of the String.

Similar questions