Scanf for double not working in Dev C++

后端 未结 4 1483
忘掉有多难
忘掉有多难 2021-01-27 11:51

I am having problem with floating point numbers. I think something is clashing here.

The output is :

\"Scre

4条回答
  •  抹茶落季
    2021-01-27 12:12

    Using wrong format specifier invoke undefined behavior and that's why you are getting unexpected result. Once UB is invoked, you may either get expected or unexpected result. Nothing can be said.
    Use %lf to read double type data.

提交回复
热议问题