TL;DR, your code invokes undefined behavior.
You're using a dangerous (thankfully, now non-standardRef) way of getting the variable types, that is, type defaults to int
.
As your variables are missing datatype definitions, they default to int
. So, inside printtit()
, a
and ch
are of type int
.
Now, by passing a
as the argument for %f
, you invoke UB already. The program (and it's output) can neither be trusted nor be justified in any way.
Note : Enable compiler warnings and pay attention to them!
Ref: Quoting from C11
(available in C99
also),
Major changes in the second edition included:
. . . .
— remove implicit int