Friday, January 17, 2020

C String Lowercase: strlwr()

The strlwr(string) function returns string characters in lowercase. Let's see a simple example of strlwr() function.

#include<stdio.h>
#include <string.h>
int main(){
char str[20];
printf("Enter string: ");
gets(str);//reads string from console
printf("String is: %s",str);
printf("\nLower String is: %s",strlwr(str));
return 0;
}

 
Output:

Enter string: ANMOLknowledge 
String is: ANMOLknowledge
Lower String is: anmolknowledge

No comments:

Post a Comment