C Tolower - C Standard Library

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Firefox https://www.programiz.com/c-programming/library-function/ctype.h/to...

C tolower()
The tolower() function takes an uppercase alphabet and
convert it to a lowercase character.

If the arguments passed to the tolower() function is other


than an uppercase alphabet, it returns the same
character that is passed to the function.

It is defined in ctype.h (/c-programming/library-function


/ctype.h) header file.

Function Prototype of tolower()

int tolower(int argument);

The character is stored in integer form in C programming.


When a character is passed as an argument,
corresponding ASCII value (integer) of the character is
passed instead of that character itself.

Example: How tolower() function works?

1 of 2 9/9/2022, 10:19 PM
Firefox https://www.programiz.com/c-programming/library-function/ctype.h/to...

#include <stdio.h>
#include <ctype.h>
int main()
{
char c, result;

c = 'M';
result = tolower(c);
printf("tolower(%c) = %c\n", c, result);

c = 'm';
result = tolower(c);
printf("tolower(%c) = %c\n", c, result);

c = '+';
result = tolower(c);
printf("tolower(%c) = %c\n", c, result);

return 0;
}

Output

2 of 2 9/9/2022, 10:19 PM

You might also like