This is a C Program to replace all the characters by lowercase.
Problem Description
This is a C Program to replace all the characters by lowercase.
Problem Solution
1. Take a string as input.
2. Use string function strlwr to replace all the characters by lowercase.
Program/Source Code
Here is source code of the C Program to replace all the characters by lowercase. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
/*
* C Program to Replace all the Characters by Lowercase
*/
#include <stdio.h>
#include <string.h>
int main()
{
char string[1000];
printf("Input a string to convert to lower case\n");
gets(string);
printf("Input string in lower case: %s\n",strlwr(string));
return 0;
}
Program Explanation
1. Take a string as input and store it in the array string[].
2. Using strlwr function replace all the characters by lowercase.
advertisement
advertisement
Runtime Test Cases
Input a string to convert to lower case CHANDANA chanikya rAVELLA Input string in lower case: chandana chanikya ravella
Sanfoundry Global Education & Learning Series – 1000 C Programs.
Here’s the list of Best Books in C Programming, Data-Structures and Algorithms
Take C Programming Tests Now!
If you wish to look at programming examples on all topics, go to C Programming Examples.
Next Steps:
- Get Free Certificate of Merit in C Programming
- Participate in C Programming Certification Contest
- Become a Top Ranker in C Programming
- Take C Programming Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Related Posts:
- Buy Computer Science Books
- Practice BCA MCQs
- Watch Advanced C Programming Videos
- Apply for Computer Science Internship
- Apply for C Internship