What is islower() in C?

islower() is a C library function. It checks whether the character passed as a parameter to it is a lowercase letter or not.

Library

#include<ctype.h>

Syntax

Following is the declaration of islower():

int islower(int ch);

where ch is the character to be checked.

The return type of the function is int. If the letter passed to the function is a lowercase letter, the function returns a non-zero value. Otherwise, the function returns zero.

Alternative approach

An alternative approach (without using islower()) to check whether a character is a lowercase letter or not, is to check if the character lies between 97 and 122 inclusive. If the character lies between 97 and 122 inclusive, it is a lowercase letter. Otherwise, it is not. This is shown in the diagram below:

%0 node_1622716089902 a node_1622716075676 97 node_1622716050693 b node_1622716123724 98 node_1622716130603 c node_1622716122386 99 node_1622716137167 d node_1622716090337 100 node_1622716122531 e node_1 101 node_2 f node_3 102
%0 node_1622716089902 g node_1622716075676 103 node_1622716050693 h node_1622716123724 104 node_1622716130603 i node_1622716122386 105 node_1622716137167 j node_1622716090337 106 node_1622716122531 k node_1 107 node_2 l node_3 108
%0 node_1622716089902 m node_1622716075676 109 node_1622716050693 n node_1622716123724 110 node_1622716130603 o node_1622716122386 111 node_1622716137167 p node_1622716090337 112 node_1622716122531 q node_1 113 node_2 r node_3 114
%0 node_1622716089902 s node_1622716075676 115 node_1622716050693 t node_1622716123724 116 node_1622716130603 u node_1622716122386 117 node_1622716137167 v node_1622716090337 118 node_1622716122531 w node_1 119 node_2 x node_3 120
%0 node_1622716130603 y node_1622716122386 121 node_1622716137167 z node_1622716090337 122
ASCII values of lowercase letters

Code

1. With islower()

#include<stdio.h>
#include<ctype.h>
int main() {
char str[] = {'q', '!', '2', 'M'};
int i = 0;
while (i < 4) {
int returnValue = islower(str[i]);
if (returnValue > 0)
printf("%c is a lowercase letter.\n", str[i]);
else
printf("%c is not a lowercase letter.\n", str[i]);
++i;
}
return 0;
}

2. Without islower()

#include<stdio.h>
#include<ctype.h>
int main() {
char str[] = {'q', '!', '2', 'M'};
int i = 0;
while (i < 4) {
if (str[i] >= 97 && str[i] <= 122)
printf("%c is a lowercase letter.\n", str[i]);
else
printf("%c is not a lowercase letter.\n", str[i]);
++i;
}
return 0;
}

Free Resources

Copyright ©2026 Educative, Inc. All rights reserved