C Program to identify a character or a digit using Built In functions
Program
#include<stdio.h>
void main()
{
char ch;
printf("Enter a character\n");
scanf("%c", &ch);
if(isalpha(ch) > 0)
printf("%c is an alphabet\n", ch);
else if(isdigit(ch) > 0)
printf("%c is a number\n", ch);
else
printf("Entered character is neither a digit nor alphabet\n");
}
Output 1
Enter a character
u
u is an alphabet
Output 2
Enter a character
)
Entered character is neither a digit nor alphabet
Output 3
Enter a character
19
19 is a number