C program to find whether a given character is an alphabet, digit or any special character(using ASCII values)

Program

#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
}

Output

DURGESH

I Love python, so I like machine learning a Lot and on the other hand, I like building apps and fun games I post blogs on my website for Tech enthusiast to learn and Share Information With The World.

Leave a Reply

Your email address will not be published. Required fields are marked *

4 × 3 =

Recent Content