C LANGUAGE - TO CHECK GIVEN CHARACTER IS ALPHANUMERIC OR NOT?
on
Get link
Facebook
X
Pinterest
Email
Other Apps
// check whether the given character is Alphanumeric or not
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
int main()
{
int ch;
clrscr();
printf( "\n Enter a character ::: " );
ch = getchar();
if( isalnum( ch ) )
{
printf( "\n It is alpha-numeric character.\n" );
}
else
{
printf( "\n This is not an alpha-numeric character.\n" );
}
getch();
return 0;
}
Note: Click on copy button to copy the given code and you can paste it in any online compiler to see the result, IF YOU ARE A MOBILE USER THEN DOWNLOAD "CODING C"(Free App) COMPILER FROM GOOGLE PLAY STORE