The program to toggle each character in a string is discussed here. A string is given as input in which all the lower case letters are converted to upper case and the upper case letters are converted to lower case.
For example, consider the following string
Input: FacePrep
Output: fACEpREP
Input: FocucAcadeMy
Output: fOCUSaCADEmy
The program to toggle each character in a string is given below.
@@coding::1@@
Time complexity: O(n)
The program to toggle each character in a string using standard library functions is given below.
@@coding::2@@