Code for Program to test the character type in C Programming
#include <stdio.h>
#include <ctype.h>
main()
{
char character;
printf("Press any key\n");
character = getchar();
if (isalpha(character) > 0)
printf("The character is a letter.");
elseif (isdigit (character) > 0)
printf("The character is a digit.");
else
printf("The character is not alphanumeric.");
}
Output
Press any key
h
The character is a letter.
Press any key
5
The character is a digit.
Press any key
*
The character is not alphanumeric.