title: lagrange interpolation how to include the interval
body: <p>I have to have this input. Unfortunately, I do not know how to include the interval a, b. Please help</p>
  
  <p>number of interpolation nodes,
  a, b, a &lt; b,
  values ​​of the function f at nodal points.
  Expected output:
  Lagrange polynomial being an interpolation of a given function in "evenly determined" interpolation nodes.</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  
  int main()
  {
      double xtab[1000], ytab[1000], results[1000];
      cout&lt;&lt;"Enter how many x and y"&lt;&lt;endl;
      int quantity;
      cin&gt;&gt;quantity;
      cout&lt;&lt;"Provide an argument to calculate"&lt;&lt;endl;
      int value;
      cin&gt;&gt;value;
      for(int i=0; i&lt;quantity; i++)
      {
          cout&lt;&lt;"enter x number"&lt;&lt;i+1&lt;&lt;": ";
          cin&gt;&gt;xtab[i];
          cout&lt;&lt;"enter y number"&lt;&lt;i+1&lt;&lt;": ";
          cin&gt;&gt;ytab[i];
      }
      for(int i=0; i&lt;quantity; i++)
      {
          results[i]=ytab[i];
          for(int k=0; k&lt;quantity; k++)
          {
              if(xtab[i]!=xtab[k])
              {
                  results[i]*=(1.000*value-xtab[k]);
              }
          }
          for(int k=0; k&lt;quantity; k++)
          {
              if(xtab[i]!=xtab[k])
              {
                  results[i]/=(1.000*xtab[i] -xtab[k]);
              }
          }
  
      }
      double sum =0;
      cout&lt;&lt;"---------------"&lt;&lt;endl&lt;&lt;"The value of the expression is: ";
      for(int i=0; i&lt;quantity; i++)
      {
          if(i!=0)
              cout&lt;&lt;" + ";
          suma+=(results[i]*1.000);
          cout&lt;&lt;results[i];
      }
      cout&lt;&lt;" = "&lt;&lt;sum&lt;&lt;endl;
      return 0;
  }
  
  </code></pre>