List of Different Specifiers in C

  • %c – Print a character
  • %d – Print a Integer
  • %i – Print a Integer
  • %e – Print float value in exponential form.
  • %f – Print float value
  • %g – Print using %e or %f whichever is smaller
  • %o – Print actual value
  • %s – Print a string
  • %x – Print a hexadecimal integer (Unsigned) using lower case a – F
  • %X – Print a hexadecimal integer (Unsigned) using upper case A – F
  • %a – Print a unsigned integer.
  • %p – Print a pointer value
  • %hx – hex short
  • %lo – octal long
  • %ld – long

No comments:

Post a Comment