title: Try statement in C?
body: <p>Is there is a try statement in C? I wan to make an "area calculator" of a trapezoid. I would expect the users to input numbers only: </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  
  main()
  {
   clrscr();
   float base1, base2, height, area;
   printf("This program will compute the area of your trapezoid. Enjoy!");
   printf("\n\tPlease enter the length of base1: ");
   scanf("%f", &amp;base1);
   printf("\tPlease enter the length of base2: ");
   scanf("%f", &amp;base2);
   printf("\tPlease enter the length of height: ");
   scanf("%f", &amp;height);
   area = (base1 + base2) * h / 2;
   printf("\nThe area of your trapezoid is: ", area);
   getch();
  }
  </code></pre>
  
  <p>But then, they have the freedom of inputting non-numeric data. Doing so will crash the program. What can I do to check if it is the right data? I believe this can be done with a loop but since there are many solutions to one program i doubt that mine is the most efficient.</p>