With
printf("%x ", test2[i]);
You are printing in hexadecimal (%x) whereas with
printf("pad = %d\n", pad);` you are printing in decimal (%d).
And (decimal) 16 => (hexa) 10, So you are displaying the right thing.
You could probably play a bit with your printing to display 16 instead of 10 but I don't think this is what you are searching for.