The C library function isalnum return non zero if character is alphanumeric (a-z, A-Z, 0-9) otherwise, it shall return 0.
Header File - #include<ctype.h>
Syntex - isalnum(variable name)
Isalnum() alphanumeric Example
|
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void
main()
{
char
numchar='A';
if(isalnum(numchar))
{
printf("numchar = %c alphanumeric \n ",numchar);
}
else
{
printf("numchar = %c is not alphanumeric \n ",numchar);
}
getch();
}
Output
|
Isalnum() non alphanumeric Example
|
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
char numchar='$';
if(isalnum(numchar))
{
printf("numchar = %c alphanumeric \n ",numchar);
}
else
{
printf("numchar = %c is not alphanumeric \n ",numchar);
}
getch();
}
Output
|
0 comments:
Post a Comment