islower function checks whether a character is lowercase alphabet(a-z) or not.
Function prototype of islower
int islower(int c);
Function islower takes a character as input in form of an integer. When we pass a value of data type char to islower function, corresponding ASCII value of that character is passed.
Return value of islower
islower in c: If passed character is a lowercase character, then islower function returns non-zero(true) integer otherwise 0(false).
C program using islower function
The following program is to check whether a character is lowercase alphabet or not.
#include <stdio.h> #include <ctype.h> #include <conio.h> int main(){ char string[] = "Aa.1"; int index = 0; while(string[index] != '\0'){ if(islower(string[index])){ printf("'%c' is a lowercase character\n", string[index]); } else { printf("'%c' is not a lowercase character\n", string[index]); } index++; } getch(); return 0; }
Output
'A' is not a lowercase character 'a' is a lowercase character '.' is not a lowercase character '1' is not a lowercase character