Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

C Library Function - islower()

C Library Function - islower()

C Standard Library - <ctype.h> C Standard Library -

Description

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

Declaration

Here is the declaration of the islower() function.



int islower(int c);

Parameters

Return Value

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

Example

The following example demonstrates the use of the islower() function.



#include 

#include 



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's compile and run the above program, which will produce the following result:



var1 = |Q| 不是小写字母

var2 = |q| 是小写字母

var3 = |3| 不是小写字母

C Standard Library - <ctype.h> C Standard Library -