/* * program to show a number of different * formatting options */ #include #include /* * and off we go! */ int main(int argc, char * argv[]) { int x = 0xdeadbeef; /* the variable */ /* the formats */ printf("%%d:(%d)\n",x); printf("%%u:(%u)\n",x); printf("%%x:(%x)\n",x); printf("%%#x:(%#x)\n",x); printf("%%#50x:(%#50x)\n",x); printf("%%#050x:(%#050x)\n",x); printf("%%1$#050x %%1$d:(%1$#050x %1$d)\n",x); printf("%%#050x:(%#050x)\n",x); printf("%%1$#050x %%1$d:(%1$#050x %1$d)\n",x); /* done! */ return(0); }