Question: ```
int i = 5;
int j = 3;
int k;
double a, b;

k = j / 2 * i / 10;
a = 0.1 * i * j / 2.0;
b = 0.1 * (j / i) + 3.0;

```

So by doing it by hand one would get k=0.75, a=0.75, and b=3.06. Yet when I solve it in Visual Studio I get 0, 0.75, and 3.00. I was hoping someone could shed light on this. I know int means only whole values can be output but why is b = 3.00 rather than 3.06 since b is a double?

Answer: 
All of your variables should be `double` because if they are `int` integer operation will occur and your result will not contain decimal places.

```
double i = 5;
double j = 3;
double k;
double a, b;

k = j / 2 * i / 10;
a = 0.1 * i * j / 2.0;
b = 0.1 * (j / i) + 3.0;

```
Operators for basic data types returns the strongest type of its two operands.

`(j / i)` is a division of integral data types, because `i` and `j` are of type `int`. Since `i` is initialized by `5` and `j` is initialized by `3` the result type of the division is `int` and the result value is `0`. 

Either you adapt your code like this to get the reusult you expected:

```
b = 0.1 * ((double)j / i) + 3.0;
                 //  ^ this is now a floating point division

```

Or like this:

```
b = 0.1 * j / i + 3.0;

```

Note the type of the result of `0.1 * j` is of type `double` because `0.1` is of type `double`.