6.3.7 islower Function

Test for a lowercase alphabetic character.

Include

<ctype.h>

Prototype

int islower (int c);

Argument

c
The character to test.

Return Value

Returns a non-zero integer value if the character, c, is a lowercase alphabetic character; otherwise, returns zero.

Remarks

A character is considered to be a lowercase alphabetic character if it is in the range of 'a'-'z'.

Example

See the notes at the beginning of this chapter or section for information on using printf() or scanf() (and other functions reading and writing the stdin or stdout streams) in the example code.

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

int main(void)
{
  int ch;

  ch = 'B';
  if (islower(ch))
    printf("B is lowercase\n");
  else
    printf("B is NOT lowercase\n");

  ch = 'b';
  if (islower(ch))
    printf("b is lowercase\n");
  else
    printf("b is NOT lowercase\n");
}

Example Output

B is NOT lowercase
b is lowercase