Hey,
im trying to print an integer to stdout in octal, hexadecimal, and quarternary number form.
I know that for octal:
and for hexidecimalCode:printf("%03o ", c);
but what about quarternary?Code:printf("%02X ", c);
thanks
Printable View
Hey,
im trying to print an integer to stdout in octal, hexadecimal, and quarternary number form.
I know that for octal:
and for hexidecimalCode:printf("%03o ", c);
but what about quarternary?Code:printf("%02X ", c);
thanks
Use something other than printf(). Not too difficult. If you need help with the source just say so. Otherwise, just break out a notepad and work on it.
Nope. And its possible, just not with printf(). You will have to write your own function. I have something important to do right now so hang tight and I can walk you through some source.
use a recursive function to repeatedly divide the number by 4 until the quotient becomes zero while printing out the remainder.