Question: Declare a string variable str as str = It is Winter. Write a program which will read each character in the string str and will

 Declare a string variable str as str = "It is Winter.

Declare a string variable str as str = "It is Winter. Write a program which will read each character in the string str and will print out 'It is a letter' if the character is a letter and 'lt is a blank' if the character is a space ( '). Display the total number of letters and the total number of blanks in the string. Also display the indices where there is a space in the string array str. (Use for loop and if-else) The output should look like: It is a letter It is a letter It is a blank It is a letter It is a letter It is a blank It is a letter It is a letter It is a letter It is a letter It is a letter It is a letter Total number of letters in the string: 10 Total number of blanks in the string: 2 The blanks in the string are at indices: 3 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!