#include <iostream.h>
int main()
{
float f =0.1;
double d = 0.1;
union f2l{
float f;
unsigned long ul;
} fl;
union d2l{
double d;
unsigned long ull[2];
} dl;
fl.f = f;
dl.d = d;
printf("hex of float is %2X/n",f);
printf("hex of float is %2X/n",fl.ul);
printf("hex of double is %2X/n",d);
printf("hex of double is %2X %2X/n",dl.ull[1],dl.ull[0]);
}
hex of float is A0000000
hex of float is 3DCCCCCD
hex of double is 9999999A
hex of double is 3FB99999 9999999A