C Library Functions -islower()

C Standard Library - <ctype.h>

Description

C Library Functionsint islower(int c)Check whether the passed character is a lowercase letter.

Declaration

Below is the declaration of the islower() function.

int islower(int c);

Parameter

  • c-- This is the character to be checked.

Return Value

If c is a lowercase letter, the function returns a non-zero value (true); otherwise, it returns 0 (false).

Example

The example below demonstrates the usage of the islower() function.

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

int main()
{
   int var1 = 'Q';
   int var2 = 'q';
   int var3 = '3';
    
   if( islower(var1) )
   {
       printf("var1 = |%c| 是小写字母\n", var1 );
   }
   else
   {
      printf("var1 = |%c| 不是小写字母\n", var1 );
   }
   if( islower(var2) )
   {
       printf("var2 = |%c| 是小写字母\n", var2 );
   }
   else
   {
      printf("var2 = |%c| 不是小写字母\n", var2 );
   }
   if( islower(var3) )
   {
       printf("var3 = |%c| 是小写字母\n", var3 );
   }
   else
   {
      printf("var3 = |%c| 不是小写字母\n", var3 );
   }
   
   return(0);
}

Let us compile and run the above program, this will produce the following result:

var1 = |Q| 不是小写字母
var2 = |q| 是小写字母
var3 = |3| 不是小写字母

C Standard Library - <ctype.h>

other extensions