Hello, my take two values of type int and divide by three other values of type int. This value is stored in the variable "answer". However, when i do this the answer it gives back is 5.0000, but the actual value should be 5.2204. Any suggestions?
// Program Numbers sends numbers to the output stream in
// specified formats.
#include <iostream>
#include <iomanip>
using namespace std;
const int NUM1 = 1066;
const int NUM2 = 1492;
const int NUM3 = 512;
const int NUM4 = 1;
const int NUM5 = -23;
I believe the above line C++ is doing the integer division instead of floating point division. Usually how I do is to put a . behind to "request" C++ to do floating point division.