You are using wrong specifier for int
data type. Its undefined behavior. Any thing could happen.
Anything at all can happen; the Standard imposes no requirements. The program may fail to compile, or it may execute incorrectly (either crashing or silently generating incorrect results), or it may fortuitously do exactly what the programmer intended.
solved printing int in c by %s in printf