Lokesh have been given a String S consisting of uppercase and lowercase English alphabets. Lokesh need to change the case of each alphabet in this String.
That is, all the uppercase letters should be converted to lowercase and all the lowercase letters should be converted to uppercase.
Lokesh need to then print the resultant String to output. But Lokesh is finding it difficult to implement it.
Can you help Lokesh complete his task?
Input:
input contains the String S
Output:
Print the String
#include <stdio.h> #include <string.h> #include <ctype.h> int main() { int i; char ch[100]; scanf("%s",ch); for(i=0;i<strlen(ch);i++) { if(isupper(ch[i])) ch[i]=tolower(ch[i]); else ch[i]=toupper(ch[i]); } printf("%s",ch); return 0; }
INPUT_1:
maHenDraSinghDhOni
OUTPUT:
MAhENdRAsINGHdHoNI
INPUT_2:
uMeshYaDhaV
OUTPUT:
UmESHyAdHAv
ILLUSTRATION
Morae Q!
- Conversion of days into year, weeks and days.
- Find if the number is a perfect number or not.
- Compute conversion of Binary to Octal.
- Return the sum of digits in a number.
- Find if a word exists or not in a sentence.
- Convert Numbers into Words.
- Read a word if it consists only of the letters known.
- Check if the string is a dynamic string or not.
- Convert all Uppercase letters to Lowercase and vice-versa.
- Change the string such that there are no matching adjacent characters.
- Find the number of sub-strings which start and end both in 1.
- Find the start and end index of unsorted sub-array.
- Find the maximum number of pairs that can be formed.
- Figure out the number of bubbly words present.
- Check if a string is lapindrome or not even with a middle character.
- Seating layout in a triangular shaped class according to the number of rows.
- Find and Sort a sub-array which makes whole array sorted.
- Seating layout according to the number of rows.
- Find the final states of the bulbs.
- Check if reversing sub array makes the array sorted.