tolower() Function in C Last Updated : 29 May, 2025 Comments Improve Suggest changes Like Article Like Report C tolower() function is part of the C standard Library used to convert the uppercase alphabet to the lowercase alphabet. It does not affect characters other than uppercase characters.Example C #include <stdio.h> #include <ctype.h> int main() { // Converting 'A' to 'a' printf("%c", tolower('A')); return 0; } OutputaSyntax of tolower()The tolower() function is defined in the <ctype.h> header file. C int tolower(int c); where,c: character that is to be converted. It is generally passed as integer that can represent an unsigned char. Return ValueIf the passed character is an uppercase character then it returns the ASCII value corresponding to the lowercase of the character passed as the argument.If the passed character is already a lowercase or not a letter then it returns the same character. Examples of tolower() FunctionsThe below examples demonstrate how to use the tolower() function in C:Example 1The below C program demonstrates the tolower() function. C #include <ctype.h> #include <stdio.h> int main() { char ch = 'M'; printf("Original Character: %c\n", ch); // convert ch to lowercase ch=tolower(ch); printf("After using tolower: %c", ch); return 0; } OutputOriginal Character: M After using tolower: mExample 2The below code converts all uppercase letters in the string to their lowercase equivalents, while leaving other characters unchanged. C #include <ctype.h> #include <stdio.h> int main() { char s[] = "Code_in_C_@0123"; printf("Original String: %s\n", s); // This will just convert // uppercase letters in string // to lowercase. Other characters // will remain unaffected. for (int i = 0; i < strlen(s); i++) { s[i] = tolower(s[i]); } printf("Converted to lowercase: %s", s); return 0; } Outputcode_in_c_@0123 Comment More infoAdvertise with us Next Article tolower() Function in C A amankr0211 Follow Improve Article Tags : Technical Scripter C Language Technical Scripter 2022 C-Functions Similar Reads strlwr() function in C The strlwr( ) function is a built-in function in C and is used to convert a given string into lowercase. Syntax: char *strlwr(char *str); Parameter: str: This represents the given string which we want to convert into lowercase. Returns: It returns the modified string obtained after converting the ch 1 min read toupper() function in C The toupper() function is used to convert lowercase alphabet to uppercase. i.e. If the character passed is a lowercase alphabet then the toupper() function converts a lowercase alphabet to an uppercase alphabet. It is defined in the ctype.h header file.Syntax: int toupper(int ch);Parameter: It accep 2 min read towupper() function in C/C++ The towupper() is a built-in function in C/C++ which converts the given wide character into uppercase. It is defined within the cwctype header file of C++. Syntax: wint_t towupper( wint_t ch ) Parameter: The function accepts a single mandatory parameter ch which specifies the wide character which we 2 min read strlen() function in c The strlen() function in C calculates the length of a given string. The strlen() function is defined in string.h header file. It doesn't count the null character '\0'. Syntax of C strlen() The syntax of strlen() function in C is as follows: size_t strlen(const char* str);Parameters The strlen() func 1 min read Function Pointer in C In C, a function pointer is a type of pointer that stores the address of a function, allowing functions to be passed as arguments and invoked dynamically. It is useful in techniques such as callback functions, event-driven programs, and polymorphism (a concept where a function or operator behaves di 6 min read Like