博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C程序查找给定字符是字母,数字还是任何特殊字符(使用ASCII值)
阅读量:2508 次
发布时间:2019-05-11

本文共 750 字,大约阅读时间需要 2 分钟。

#include<stdio.h>

#include<conio.h>

void main()
{


    char ch;
    clrscr();    //to clear the screen
    printf(“Enter any character:”);
    scanf(“%c”,&ch);

    if((ch>=’A’&&ch<=’Z’)||(ch>=’a’&&ch<=’z’))
        printf(“nYou have entered an alphabet”);
    else
        if(ch>=’0’&&ch<=’9′)
            printf(“nYou have entered a digit”);
        else
            printf(“nYou have entered a special character”);

    getch();    //to stop the screen
}

#include<stdio.h>

#include<conio.h>

void main()
{


    char ch;
    clrscr();    //to clear the screen
    printf(“Enter any character:”);
    scanf(“%c”,&ch);

    if((ch>=’A’&&ch<=’Z’)||(ch>=’a’&&ch<=’z’))
        printf(“nYou have entered an alphabet”);
    else
        if(ch>=’0’&&ch<=’9′)
            printf(“nYou have entered a digit”);
        else
            printf(“nYou have entered a special character”);

    getch();    //to stop the screen
}

翻译自:

转载地址:http://trwwd.baihongyu.com/

你可能感兴趣的文章
oracle的级联更新、删除
查看>>
多浏览器开发需要注意的问题之一
查看>>
Maven配置
查看>>
HttpServletRequest /HttpServletResponse
查看>>
SAM4E单片机之旅——24、使用DSP库求向量数量积
查看>>
从远程库克隆库
查看>>
codeforces Unusual Product
查看>>
hdu4348 - To the moon 可持久化线段树 区间修改 离线处理
查看>>
线性表的应用
查看>>
Asp.net网站的简单发布
查看>>
JAVA中enum的常见用法
查看>>
查找后去掉EditTextView的焦点
查看>>
springMVC中一个class中的多个方法
查看>>
Linux系统安装出错后出现grub rescue的修复方法
查看>>
线段树模板整理
查看>>
[教程][6月4日更新]VMware 8.02虚拟机安装MAC lion 10.7.3教程 附送原版提取镜像InstallESD.iso!...
查看>>
Guava之FluentIterable使用示例
查看>>
[iOS问题归总]iPhone上传项目遇到的问题
查看>>
软件包管理:rpm命令管理-包命名与依赖性
查看>>
iOS之瀑布流布局设计
查看>>