title: Program returning inf?
body: <p>I think the error lies in this line:</p>
  
  <pre><code>float bmi = weight * 703 / pow(height, 2.0); // user inputs weight and height and the bmi should be calculated.
  </code></pre>
  
  <p>The thing is, I created a sort of mock program with the values already put in and everything was fine. But when I use scanf() to have the user put in those same values it doesn't work. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main ()
  {
      float weight = 105, height = 63;
      float bmi;
      bmi = weight * 703 / pow(height, 2.0);
      printf("%f\n", bmi);
  }
  </code></pre>
  
  <p>Both weight and height are floats. When I try to print the bmi I get "inf."</p>
  
  <p>** Edited to show input function and print statement.</p>
  
  <pre><code> printf("Weight? ");
      scanf("%f", &amp;weight);
  
  printf("BMI is %.2f.\n", bmi);
  </code></pre>
  
  <p>The other input statement is essentially the same with the word height replacing weight. </p>
  
  <p>edit: Here is the entire code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main ()
  {
      float weight, height;
      float bmi = weight * 703 / pow(height, 2.0);
  
      printf("Height? ");
      scanf("%f", &amp;height);
  
      printf("Weight? ");
      scanf("%f", &amp;weight);
  
      printf("Your BMI is calculated at %.2f.\n", bmi);
  
      printf("%f\n", height);
      printf("%f\n", weight);
  
  
  }
  </code></pre>