title: A code for finding one root of fifth degree polynomial
body: <p>I'm trying to write a code that asks from the user to give 5 coefficients for a 5th-degree polynomial, and it also asks to give a range (two values) that the programs checks if there is a solution in it or not (I'm asked to find only one), and the solution must be an integer, while the coefficients can be floats.  </p>
  
  <p>I'm thinking of writing a code that runs over every integer in the range and substitute it in a description of a polynomial than I define, and check if its equal to zero, but I got stuck at deciding how to make the loops. </p>
  
  <p>And another thing, if there are more than one root in the interval that the user enters, then we must print the minimal value of the roots (but I have no direction how to do that either).</p>
  
  <p>I will show you what I wrote so far, and any kind of help would be appreciated:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define zero 0.00001
  
  int main()
  {
      double a, b, c , d , e , f , y ,  beginning_of_range, end_of_range;
  
      int x;
  
      printf("please enter the coefficients of the polynomial:\n");
  
      scanf("%lf%lf%lf%lf%lf", &amp;a, &amp;b, &amp;c, &amp;d, &amp;e);
  
      printf("please enter two values to indicate the beginning and end of range:\n");
  
      scanf("%lf%lf", &amp;beginning_of_range, &amp;end_of_range);
  
      while (beginning_of_range &gt; end_of_range)
      {
          printf("ERROR: the range you have entered isn't valid, please try again:");
  
          scanf("%lf%lf", &amp;beginning_of_range, &amp;end_of_range);
      }
  
      while (beginning_of_range &lt; end_of_range)
      {
          x = beginning_of_range;
  
          y = a + b*x + c*x*x + d*x*x*x + e*x*x*x*x + f*x*x*x*x*x;
  
          if (y == zero)
          {
              printf("the root is:%d", x);
  
          }
          else 
          {
              x = x+1;
          }
  
          break;
  
      }
  
      return 0;
  }
  </code></pre>