+ 1
Confusion in c++
Why the output of (1/2)*5*10 is 0. It should be 25.
2 odpowiedzi
+ 2
You're probably using integers. Convert at least one of them to double: (double)1/2*5*10 = 25
+ 1
Or use 1.0/2 instead of 1, compiler will detect the type of the left operand.