C – program to input any Character and check whether it is a ALPHABET, DIGIT or a SPECIAL Character

#include <stdio.h>
int main()
{
char value;
printf("Enter any character: ");
scanf("%c", &value);
if ((value >= 'a' && value <= 'z') || (value >= 'A' && value <= 'Z'))
{
printf("%c is an alphabet.", value);
}
else if (value >= '0' && value <= '9')
{
printf("%c is a digit.", value);
}
else
{
printf("%c is a special character.", value);
}
return 0;
}
Scroll to Top
logo
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.