uint64_t foo = ...; printf("foo = %ju\n", (uintmax_t)foo); /* OR */ printf("foo = %llu\n", (unsigned long long)foo);