#include int main() { float a = 1234.5f; printf(\"%d\\n\", a); return 0; }
It displays a 0!! How is that
0
It won't convert automatically float to integer. Because both has different format of storage. So if you want to convert, use (int) typecasting.
#include int main() { float a = 1234.5f; printf("%d\n", (int)a); return 0; }