An alphanumeric character is one that is either an uppercase or lowercase letter or a digit. The statement given below tests whether character ch is an alphanumeric character or not.
#include<ctype.h>
#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
for(;;){
ch = getchar();
if(ch=='.')
break;
if(isalnum(ch)) printf("%c is alphanumeric\n", ch);
}
getch();
}
OUTPUT:
a
a is alphanumeric