C语言常用函数-islower()判断字符是否为小写英文字母函数

演示版本

VS2013

  • islower()函数

islower()函数用于判断字符是否为除空格外的可打印字符。

语法

int islower(int ch);

islower()函数的语法参数说明如下:

参数ch为一个待检查的字符。

islower()函数返回值:不是小写英文字母返回0,是则返回非0。

示例

本示例演示用islower()函数判断输入的字符是否为小写英文字母。其具体代码如下:

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

int main()
{
    char ch;
    printf("input a character:");//输入一个字符
    scanf_s("%c", &ch);
    if (islower(ch))//判断输入字符是否为英文小写字母
        printf("%c is lower alpha
", ch);
    else
        printf("%c is not lower alpha
", ch);


    return 0;
}

阿飞

2021年7月26日

原文地址:https://www.cnblogs.com/nxopen2018/p/15063673.html