1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int n = 0262; // "one-hundred seventy-eight"
int m = 0262 + 0xb; // "one-hundred ninety"
int o = 0262 + 0xb + 10; // "two-hundred"
printf("n = %d (written in base 10)\n", n);
printf("n = %x (written in base 16)\n", n);
printf("n = %o (written in base 8)\n", n);
printf("o = %d (written in base 10)\n", o);
printf("o = %x (written in base 16)\n", o);
printf("o = %o (written in base 8)\n", o);
return EXIT_SUCCESS;
}
|
© Copyright 2016 Alexander J. Quinn This content is protected and may not be shared, uploaded, or distributed.