演示版本

VS2013

  • 判断字母是否大写

实例说明:

输入一个字母,判断是否为大写字母。如果是,则提示"uppercase-letter!",否则提示"other-letter!"。

利用if语句判断输入字符的ASCII码是否在65~90这个范围内,如果在,则该字符是大写字母;否则不是大写字母。

#include <stdio.h>
#include <math.h>

int main()
{
    char c;
    printf("输入一个字母:\n");
    c = getchar();
    if (c >= 65 && c <= 90)
        printf("uppercase letter!\n");
    else
        printf("other letter!\n");


    return 0;
}

C语言编程例子-判断字母是否大写

 

阿飞

2021年8月6日

相关文章:

  • 2022-12-23
  • 2022-01-11
  • 2021-11-28
  • 2021-08-12
  • 2021-07-03
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案