Question: what is the difference between d and i in c?
Answer: %d specifies signed decimal integer while %i specifies integer. There is no difference between the %i and %d format specifiers for printf. Consider a following example. %d assume base 10 while %i auto detects the base.