%i and %d are equivalent. both of them specify the format for a signed decimal integer, and either are acceptable to use
just as an afterthought, i should clarify that the above statement is only strictly true for
"printf()"
for
"scanf()", the %d and %i are subtly different ... %d requires a decimal (base 10) integer input, while %i assumes decimal by default, but will also read number as octal if it is prefixed by '0', or hexadecimal if prefixed by '0x' or '0X'
Last edited by jephthah; Jul 3rd, 2009 at 12:06 am.
Reputation Points: 2143
Solved Threads: 178
Posting Maven
Offline 2,567 posts
since Feb 2008