You can use the same ll size modifier for %x, thus:
#include <stdio.h>
int main() {
unsigned long long x = 123456789012345ULL;
printf("%llx\n", x);
return 0;
}
The full range of conversion and formatting specifiers is in a great table here:
printfdocumentation on cppeference.com