#include <stdio.h>

int main() {
   int a = 1234;
   printf("%#o %#X\n",a,a);
    return 0;
}

八进制%o,十六进制%X;

显示前导符号:八进制%#o,十六进制%#X