strlwr(): String Lower Case in C Programming

String handling function strlwr() is used to convert all upper case letter in string to lower case i.e. strlwr(str) converts all upper case letter in string str to lowercase.

strlwr() Syntax


strlwr( string);

strlwr() Program


#include
#include<string.h>

int main()
{
 char str[40];

 printf("Enter string:\n");
 gets(str);
 strlwr(str);
 printf("String in lowercase is:");
 puts(str);

 return 0;
}

strlwr() Program Output


Enter string:
WeLcOmE To C 101. ↲
String in lowercase is:
welcome to c 101.