In this program, we will take a string as input and avoid spaces in the string and get the total length.
Steps to solve the program
- Take a string as input.
- Use for loop to iterate over each character of the string.
- Use isspace() to check whether a character is a space or not.
- Find the total of such characters who are not space.
- Print the output.
Output :