4. printf hex cboard.cprogramming.com
As with all printf() formatting, you use the correct format template specifier. In the case of hexadecimal, you can use either "%x" or "%X", depending on whether you want the alpha digits to be upper or lower case. To get a particular width, with zero padding on the left, you use something like "%08x" (assuming that you want to print the ...