C programming ctype.h function - int islower(int c)

The int islower(int c) function in the ctype.h library of C programming is used to determine whether a given character is a lowercase alphabetic character.

The islower() function takes a single integer argument c, which is the character to be checked. The function returns an integer value, which is nonzero if the character is a lowercase alphabetic character, and zero otherwise.

Here's an example of how to use the islower() function in C:

refer t‮:o‬theitroad.com
#include <stdio.h>
#include <ctype.h>

int main() {
    char c = 'a';
    if (islower(c)) {
        printf("%c is a lowercase letter\n", c);
    } else {
        printf("%c is not a lowercase letter\n", c);
    }
    return 0;
}

In this example, the islower() function is used to check whether the character 'a' is a lowercase alphabetic character. Since 'a' is a lowercase alphabetic character, the function returns a nonzero value, and the output will be: 'a' is a lowercase letter.

If the character had been an uppercase character such as 'A', the islower() function would return zero, and the output would be: 'A' is not a lowercase letter.