Multiple choice

Which format specifier is used for printing an unsigned integer in hexadecimal number system?

  1. %h

  2. %u

  3. %x

  4. %hd

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

%x is the format specifier, which is used for printing an unsigned integer in hexadecimal number system. %h is not a valid format specifier. %u is used for printing the unsigned integer in decimal number system. %hd is used for printing the signed short.