#include int main() { float a = 1234.5f; printf(\"%d\\n\", a); return 0; }
It displays a 0!! How is that
0
Since you tagged it with C++ as well, this code does the conversion as you probably expect:
#include int main() { float a = 1234.5f; std::cout << a << " " << (int)a << "\n"; return 0; }
Output:
1234.5 1234