title: Midpoint Rule - Numerical Method in C
body: <p>I want to calculate approximate area that remains under the curve. Actually it is not about the mathematical isue.
  This code doesnt print anything.
  Where is the problem?
  thanks in advance</p>
  
  <pre><code>double midpointrule(double,double,int);
  
  int main(int argc, char *argv[]) {
  double x,y;
  int z;
  scanf("%lf %lf %d", &amp;x, &amp;y, &amp;z);
  double midpointrule(x,y,z);
  }
  
  
  double midpointrule(double uplimit,double lowlimit,int interval)
  {
      int i;
      double func1=0, func2=0;
      double deltax = (uplimit - lowlimit)/interval;
      for(i=1; i&lt;=interval; i++)
      {
          func1 = func1 + pow(M_E,pow(deltax,2));
          func2 = func2 + 2*pow(M_E,deltax) - 2*deltax;
      }
  func1 = func1*deltax;
  func2 = func2*deltax;
  
  
  printf("midpoint result for func1 = %lf\n", func1);
  printf("midpoint result for func2 = %lf\n", func2);
  }
  </code></pre>