bases.c 248 B

1234567891011
  1. /* bases.c--prints 100 in decimal, octal, and hex */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. int x = 100;
  6. printf("dec = %d; octal = %o; hex = %x\n", x, x, x);
  7. printf("dec = %d; octal = %#o; hex = %#x\n", x, x, x);
  8. return 0;
  9. }