title: How do I make a C program that does not exit immediately when entered an error?
body: <p>Consider:</p>
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;windows.h&gt;
  
  int main() {
      double Height = 0;
      double Diameter = 0;
      double Radius;
      double pi = 3.14;
      double Area;
      double volume;
      printf(&quot;Enter the Height in cm: \n&quot;);
      scanf(&quot;%lf&quot;, &amp;Height);
      printf(&quot;Enter the Diameter in cm: \n&quot;);
      scanf(&quot;%lf&quot;, &amp;Diameter);
      Radius = Diameter / 2.0;
      Area = pi * Radius * Radius;
      volume = Area * Height;
      printf(&quot;\n\n%fcm3\n\n&quot;, volume);
      system(&quot;pause&quot;);
      return 0;
  }
  </code></pre>
  <p>This is a volume calculator program. Is there a possible way to make my program not exit immediately when I enter an invalid value?</p>
  <p>Example: entering a string. If I did that, my program immediately exits.</p>