In this program, we will take a string as input and insert space before every capital letter appears in a given word.
Steps to solve the program
- Take a string as input and create an empty string.
- Use for loop to iterate over every character of the string.
- Add each character to the empty string.
- If a character is Capital letter then add space first then the character.
- Print the output.
Output :