$ curl cheat.sh/
/*
 * They are completely equivalent when used with `printf()`. Personally,
 * I prefer `%d`, it's used more often (should I say "it's the idiomatic
 * conversion specifier for `int`"?).
 * 
 * (One difference between `%i` and `%d` is that when used with
 * `scanf()`, then `%d` always expects a decimal integer, whereas `%i`
 * recognizes the `0` and `0x` prefixes as octal and hexadecimal, but no
 * sane programmer uses `scanf()` anyway so this should not be a
 * concern.)
 * 
 * [user529758] [so/q/17329647] [cc by-sa 3.0]
 */

$
Follow @igor_chubin cheat.sh