islower() function is used to check whether a character is a lowercase letter or not. It is a standard library function defined in the <ctype.h> header file.
Syntax:
int islower(int ch);
Here, ch is the character to be checked.
Return Value:
- If the character is a lowercase letter, the function returns a non-zero value.
- If the character is not a lowercase letter, it returns 0.
Example:
Input: A The given character is not a lowercase letter Input: a The given character is a lowercase letter Input: 1 The given character is not a lowercase letter
// C program to demonstrate
// the islower() function
#include <ctype.h>
#include <stdio.h>
int main()
{
char ch = 'g';
if (islower(ch) != 0) {
printf(
"The given character is a lowercase letter.\n");
}
else {
printf("The given character is not a lowercase "
"letter.\n");
}
return 0;
}
Output:
The given character is a lowercase letter.