(HackerRank) Write a Modular C Programming code to solve Replace upper case with lower case, Given a string replace every occurrence of upper case character with the lower case.
Given a string replace every occurrence of upper case character with the lower case.
Input Format
First Line contains a string
Constraints
1<= |S| < = 1000
Output Format
Output the string where every occurrence of upper case is replaced with lower case.
Sample Input 0
aBcD12&q
Sample Output 0
abcd12&q
CODE:
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main() { char word[20]; int i=0; scanf("%s",word); while(word[i]) { if(word[i]>=65 && word[i]<=90) word[i]+=32; i++; } printf("%s",word); return 0; }
OUTPUT
Congratulations, you passed the sample test case. Click the Submit Code button to run your code against all the test cases. Input (stdin) aBcD12&q Your Output (stdout) abcd12&q Expected Output abcd12&q
Please find some more codes of Loops, Condition Statements, 1D Arrays, 2D Arrays, Strings, Pointers, Data Structures, Files, Linked lists, Stacks, Queues, Binary Trees, MISC, Solved model question papers & Hacker Rank all solutions on the below page:
Top 100+ C Programming codes – KLE Technological University