So I'm just diving into C during my first few days of classes. My professor proposed a question/ more of a challenge for us so I thought I'd propose it here.
float x,y,z;
x = 0.0;
y = 1.0;
z = -2.5;
He wanted us to display these numbers in binary and hexadecimal without using %x
etc. He also hinted to use a union:
union U {
float y;
unsigned z;
};
Thank you for your time in advance. I'm just looking for help/ an explanation on how to develop such conversion.