Working with Hexadecimal values in C programming language
Learn C - C tutorial - working with hexadecimal values in c programming language - C examples - C programs
Working with Hexadecimal values in C programming language
- Hexadecimal is a positional numeral system with a radix, or base, of 16.
- It uses sixteen distinct symbols.
- First symbols 0-9 to appointed to act values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen.
Learn C - C tutorial - working with hexadecimal values in c programming language - C examples - C programs
Sample Code
#include <stdio.h>
int main()
{
unsigned char a=0x64;
int b=0xFAFA;
printf("value of a: %X [%x]\n",a,a);
printf("value of b: %X [%x]\n",b,b);
return 0;
}
Output
value of a: 64 [64]
value of b: FAFA [fafa]