I have a simple program :
#include
int main()
{
long i = 16843009;
printf (\"%02x \\n\" ,i);
}
I am using
%x
is a format specifier that format and output the hex value. If you are providing int or long value, it will convert it to hex value.
%02x
means if your provided value is less than two digits then 0
will be prepended.
You provided value 16843009
and it has been converted to 1010101
which a hex value.