C islower()

Function Prototype of islower()

int islower( int arg );

Function islower() takes a single argument in the form of an integer and returns a value of type int.

Even though islower() takes integer as an argument, character is passed to the function. Internally, the character is converted to its ASCII value for the check.

It is defined in <ctype.h> header file.


C islower() Return Value

Return Value Remarks
Non-zero number (x > 0) Argument is a lowercase alphabet.
Zero (0) Argument is not a lowercase alphabet.

Example: C islower() function

#include <stdio.h>
#include <ctype.h>

int main()
{
    char c;

    c='t';
    printf("Return value when %c is passed to islower(): %d", c, islower(c));

    c='D';
    printf("\nReturn value when %c is passed to islower(): %d", c, islower(c));

    return 0;
}

Output

Return value when t is passed to islower(): 2
Return value when D is passed to is islower(): 0

Note: You may get different integer value when lowercase alphabet is passed to islower() on you system. But, when you pass any other character than lowercase character to islower(), it always returns 0.

Did you find this article helpful?