Thank you, got it fixed with the float command :)
Last edited on
You might be able to get away with making all your variables
float
. However, you should cast your constants appropriately just to avoid any problems:
http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/
What's happening with your program right now is because all your numbers are integers, the result is also truncated to be an int.
Last edited on