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


演示版本

VS2013

  • isupper()函数

isupper()函数用于判断字符是否为大写英文字母。

语法

int isupper(int ch);

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

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

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

示例

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

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

int main()
{
    char ch;
    printf("input a character:");
    scanf_s("%c", &ch);
    if (isupper(ch))
        printf("%c is upper\n", ch);
    else
        printf("%c is not upper\n", ch);

    return 0;
}

 

阿飞

2021年7月26日


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM