How does this program work?

前端 未结 13 2073
闹比i
闹比i 2020-11-30 22:44
#include 

int main() {
    float a = 1234.5f;
    printf(\"%d\\n\", a);
    return 0;
}

It displays a 0!! How is that

相关标签:
13条回答
  • 2020-11-30 23:38

    It's not an integer. Try using %f.

    0 讨论(0)
提交回复
热议问题