C isalnum()

The isalnum() function returns nonzero if its argument is either a letter of the alphabet or a digit. If the character is not alphanumeric, zero is returned.

isalnum() Syntax

Following is the syntax of the isalnum() function :

int isalnum(int ch);

isalnum() Example

The following program checks each character read from stdin and reports all alphanumeric characters :

void main()
	char ch;
	for(; ;)
		ch = getc(stdin);
		if(ch == '.')
			printf("%c is alphanumeric\n", ch);

C Online Test

« Previous Function Next Function »

Like/Share Us on Facebook 😋