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
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
If you wish to look at programming examples on all topics, go to C Programming Examples.
Related Posts:
- Apply for Computer Science Internship
- Check Computer Science Books
- Apply for C Internship
- Check C Books
- Practice Computer Science MCQs