Dividing two double numbers in C++
<p>I have some experience in C++. I wrote the following code;</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

double mass_H;
double mass_S;
double Mass;
double S_Space;
double H2S_Conc;
double Conc;



// calculates the molecular mass of H2S, given the molecular mass of each element
void Molecular_Mass()
{
    Mass = ((2*mass_H)+(mass_S));
}

void H2S_Concentration()
{

    Conc = H2S_Conc/100;
    //c = H2S_Conc/1000000;
}


int main()
{

    cout &lt;&lt; "Welcome to the H2S conversion .\n";
    cout &lt;&lt; "Please enter molecular mass of Hydrogen: "&lt;&lt;endl;          // enter mass of hydrogen
    cin &gt;&gt; mass_H;
    cout &lt;&lt; "Please enter molecular mass of Sulphur: " &lt;&lt; endl;         // eneter mass of sulpher
    cin &gt;&gt; mass_S;

    Molecular_Mass();
    H2S_Concentration();                                                  // call molecular mass function
    S_Space = 22.41;  //Nm^3/kmol
    H2S_Conc = 292; // ppm v/v

    cout &lt;&lt; "Molecular mass of H2S is: " &lt;&lt; Mass &lt;&lt; "kg/kmol"&lt;&lt; endl;
    cout &lt;&lt; "Standard space occupied by a kmol at 0 degrees and 1 atm is: "&lt;&lt; S_Space &lt;&lt; "Nm^3/kmol" &lt;&lt;  endl;
    cout &lt;&lt; "H2S concentration is: " &lt;&lt; H2S_Conc &lt;&lt; "parts per million, which is a real concentration of: " &lt;&lt; Conc &lt;&lt;endl;
</code></pre>

<p>The problem is when I compile and run, my value for Conc is 0. I am dividing two doubles, which I thought wasn't a problem.</p>

<p>I have had a look on google and I tried casting, by using a float but that didnt work either. </p>

<p>Can anyone tell me why it is returning zero</p>

<p>p.s ignore the rest of my crappy code ;)</p>