What is difference between %d and %i in c?



What is difference between %d and %i in c?..

Answer / Vineet Kumar Verma

In C, %d is used to represent a signed decimal integer, while %i can be used interchangeably with %d for the same purpose. The difference lies in their portability: %i can handle integer types from different systems, while %d might require some platform-specific adjustments.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is scope and lifetime of a variable in c?

1 Answers  


Explain the properties of union.

1 Answers  


# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }

5 Answers  


What is union and structure?

1 Answers  


c program to manipulate x=1!+2!+3!+...+n! using recursion

1 Answers   TCS,


Tell about strtok & strstr functions

2 Answers   HCL, iFlex, Motorola,


Explain enumerated types in c language?

1 Answers  


What are the types of type specifiers?

1 Answers  


Is there any data type in c with variable size?

1 Answers  


What is fflush() function?

1 Answers  


What do you mean by invalid pointer arithmetic?

1 Answers  


What is else if ladder?

1 Answers  


Categories