islower function(Test for Lowercase Letter) in C Language – example and detail

In the C Programming Language, the islower feature exams whether or not c is a lowercase letter.

Syntax

The syntax for the islower function in the C Language is:

int islower(int c);

Parameters or Arguments

c The cost to test whether or not it is a lowercase letter.

Returns

The islower characteristic returns a nonzero cost if c is a lowercase letter and returns zero if c is not a lowercase letter.

Required Header

In the C Language, the required header for the islower characteristic is:

#include <ctype.h>

Applies To

In the C Language, the islower function can be used in the following versions:

ANSI/ISO 9899-1990

islower Example

Let’s appear at an instance to see how you would use the islower characteristic in a C program:

/* Example using islower by TechOnTheNet.com */

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

int main(int argc, const char * argv[])
{
    /* Define a variable to hold our test letter */
    int letter;

    /* Set the letter to a lowercase 'b' */
    letter = 'b';

    /* Test to see if the letter provided is lowercase */
    if (islower(letter)) printf("'%c' is lowercase\n", letter);
    else printf("'%c' is uppercase\n", letter);

    /* Set the letter to a uppercase 'B' */
    letter = 'B';

    /* Test to see if the letter provided is lowercase */
    if (islower(letter)) printf("'%c' is lowercase\n", letter);
    else printf("'%c' is uppercase\n", letter);

    return 0;
}

When compiled and run, this application will output:

'b' is lowercase
'B' is uppercase

Similar Functions

Other C functions that are comparable to the islower function:

isalpha characteristic isupper feature tolower characteristic toupper characteristic

See Also

Other C features that are noteworthy when dealing with the islower function:

isalnum function <ctype.h>