Latest web development tutorials

C library functions - islower ()

C standard library - <ctype.h> C standard library - <ctype.h>

description

Whether the C library functionint islower (int c) Check the transmission characters are lowercase.

statement

Here is () statement islower function.

int islower(int c);

parameter

  • c - This was a test of character.

return value

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

Examples

The following example demonstrates islower () function is used.

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

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

C standard library - <ctype.h> C standard library - <ctype.h>