Home  >  Q&A  >  body text

c++ - C语言函数实际声明类型为int,接受返回值类型为float,最终返回结果以什么为准?

怪我咯怪我咯2714 days ago590

reply all(4)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 14:43:15

    1. I typed it myself and the result was 5.00. The answer is wrong. It may be the difference between compilers. I use gcc;

    2. In addition, it is recommended not to use mobile phone software to answer these basic questions. They do not know where to find the questions and answers. It is recommended to directly look for the C language final examination paper from a prestigious school and do it

    reply
    0
  • PHPz

    PHPz2017-04-17 14:43:15

    I debugged it with the C++ compiler and found that the answer is 5.
    There are many explicit or implicit type conversions in this program. The topic is the same as the link description in this article

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 14:43:15

    I think the answer is wrong, why don’t you write a program yourself and try it

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 14:43:15

    The answer is wrong, I personally think

    reply
    0
  • Cancelreply