how to check whether given numbe ris hex or not

helo I have particular number

lets say 0x56

now thropugh c program how to check this number is hex or not

Regards,
Amit

All numbers are (normally) represented internally as binary objects. Do you mean you have a particular string that you want to parse? And you want to know if this string is hex? Or do you just want to parse any string -- decimal or hex -- into the proper internal representation?

Certain conventions are used when dealing with numbers in different bases. Hex digits are prefixed with 0x or 0X; octals have a leading zero; and decimals are written as is...

int dec, oct, hx;
oct = 056; /* octal 56 */ 
hx = 0x56; /* hex 56 */
dec = 56; /* decimal 56 */

Is that it or are you looking to parse a string of characters into hex / decimal digits? The requirements are not clear from your post.

Or maybe you are simply looking for isxdigit()

prefixed with 0x and every digit must be in between 0-9 and a-f.