
- C Library - Home
- C Library - <assert.h>
- C Library - <complex.h>
- C Library - <ctype.h>
- C Library - <errno.h>
- C Library - <fenv.h>
- C Library - <float.h>
- C Library - <inttypes.h>
- C Library - <iso646.h>
- C Library - <limits.h>
- C Library - <locale.h>
- C Library - <math.h>
- C Library - <setjmp.h>
- C Library - <signal.h>
- C Library - <stdalign.h>
- C Library - <stdarg.h>
- C Library - <stdbool.h>
- C Library - <stddef.h>
- C Library - <stdio.h>
- C Library - <stdlib.h>
- C Library - <string.h>
- C Library - <tgmath.h>
- C Library - <time.h>
- C Library - <wctype.h>
- C Programming Resources
- C Programming - Tutorial
- C - Useful Resources
C Library - islower() function
The C ctype library islower() function is used to check whether the passed character is a lowercase letter.
Syntax
Following is the C library syntax of the islower() function −
int islower(int c);
Parameters
This function accepts a single parameter −
c − This is the character to be checked, passed as an integer. The value must be representable as an unsigned char or the value of EOF.
Return Value
The function returns a non-zero value (true) if c is a lowercase letter ('a' to 'z').It returns 0 (false) if c is not a lowercase letter.
Example 1: Checking Characters
Here islower() checks different types of input like uppercase character, lowercase characters and numbers/digits.
#include <stdio.h> #include <ctype.h> int main () { int var1 = 'Q'; int var2 = 'q'; int var3 = '3'; if( islower(var1) ) { printf("var1 = |%c| is lowercase character\n", var1 ); } else { printf("var1 = |%c| is not lowercase character\n", var1 ); } if( islower(var2) ) { printf("var2 = |%c| is lowercase character\n", var2 ); } else { printf("var2 = |%c| is not lowercase character\n", var2 ); } if( islower(var3) ) { printf("var3 = |%c| is lowercase character\n", var3 ); } else { printf("var3 = |%c| is not lowercase character\n", var3 ); } return(0); }
Output
The above code produces following result−
var1 = |Q| is not lowercase character var2 = |q| is lowercase character var3 = |3| is not lowercase character
Advertisements