computation involving multiple types of variable
<p>For the computation involving multiple types of variables, such as integer and double, is the following approach the correct way in terms of not causing any hidden error or information lost?</p>

<pre><code>    int a = 2;
    double b = 3.0;
    double c;
    c = (double)(a+b);
    c = (double)(a/b);
</code></pre>

<p>Another scenario is that: </p>

<pre><code>int x =2;
int y = 3;
double z;
</code></pre>

<p>z=x/y will not give me correct value like 0.666666666, how to handle this kind of scenario?</p>
