codescracker


c

C isxdigit()



« Previous Chapter Next Function »


isxdigit()

The isxdigit() function returns nonzero if ch is a hexadecimal digit; otherwise zero is returned. A hexadecimal digit will be in one of these ranges: A-F, a-f, or 0-9.

isxdigit() Syntax

Following is the syntax of the isxdigit() function :

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

isxdigit() Example

Following program checks each character read from stdin and reports all hexadecimal digits :

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

« Previous Chapter Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test