Header Ads Widget

C-program to check that given character is an alphabet, digit or special character

Here in this post we will write a program to check the given character is alphabet or digits or a special character. So for this we will use ASCII value  as we know the ascii of A-Z is 65-90 and a-z is 97-122 , The ascii of 0-9 is 48-57 and except these all are the special characters. So here is the program to check that the given character is alphabet , digits or a special character.
C-program to check that the given character is alphabet , digit or a special character

Code:-
#include<stdio.h>
int main()
{
char n;
printf("Enter any character:");
scanf("%c",&n);
if((n>=65 && n<= 90) || (n>=97 && n<=122))
printf("This is an Alphabet");
else if(n>=48 && n<=57)
printf("This is a Number");
else
printf("This is a special character");
return 0;
}


Output:-
Enter any character: 9
This is a Number





Keywords:- 

 ,write a program to check whether the given input is alphabet number or special character in c,

,write a c program to check whether a character is an alphabet digit or special character,

,write a program to check whether the given input is alphabet number or special character in python,

,write a c program to check whether an alphabet is a vowel or consonant,

,special characters in c programming language,

,write a program to check whether the given input is alphabet number or special character in java,

,c program to determine the character entered by user,

,c program to find special characters in string,

,special characters in c programming language,

,write a program to check whether the given input is alphabet, number or special character in java,

,c program to determine the character entered by user,

,c program to find special characters in string,

,write a program to check whether the given input is alphabet, number or special character in c#,

,write a c++ program to check whether a character is an alphabet, digit or special character.,

Recommended Post:

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-


Post a Comment

0 Comments