View algorithms on Strings
Question: Write a program that changes the case of each character in a string. If its uppercase, convert it to lowercase and vice-versa. Input: ThE quiCK brOwN FOX jUMPs. Output: tHe QUIck BRoWn fox Jumps. In this program we shall apply the basic principle that each character is represented as an integer ASCII code. For more reference look into the post – Find the case of a character input by the user. Now we know that ‘a’ -> ASCII CODE = 97 ‘A’ -> ASCII CODE = 65 Thus the …
