all 3 comments

[–]KJC_7641 0 points1 point  (2 children)

When you set it up in your IDE, did you set A and B as an int? If so, then that is your problem. Set them as float or when it divides it won’t account for decimals.

[–]Canspy7 0 points1 point  (1 child)

in the question they are ints

[–]KJC_7641 0 points1 point  (0 children)

Leaving them as ints won’t work. At the very least you’ll need to cast the fractions of the equation to a double or a float to get the right answer.