codescracker


c

C isalnum()



« Previous Function Next Function »


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 :

#include<ctype.h>
int isalnum(int ch);

isalnum() Example

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

#include<ctype.h>
#include<stdio.h>
#include<conio.h>
void main()
{
	clrscr();
	char ch;
	for(; ;)
	{
		ch = getc(stdin);
		if(ch == '.')
			break;
		if(isalnum(ch))
			printf("%c is alphanumeric\n", ch);
	}
	getch();
}

« Previous Function Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test