Having trouble passing reference : <p>Within my code I keep getting an error sayong that the "n" in the main function is undeclared even though I declare it in "double mols"</p>

<pre><code>#include &lt;iostream&gt;

 using namespace std;
 const double idealGas = 8.3144598;


 double mols(double mass, double molarMass);
 double pressure(double v, double n, double t);

 int main() {

     cout &lt;&lt; "the mols are " &lt;&lt; mols(5.0,20.0) &lt;&lt;  "\n" &lt;&lt; "the pressure is" &lt;&lt; pressure(3.0,n,293) &lt;&lt; endl;

     return 0;
 }

 double mols(double mass, double molarMass){

     double n = mass/molarMass;
     return n;
 }

 double pressure(double v, double n, double t){

     double p = (n*idealGas*t)/v;
     return p;
 }
</code></pre>
