title: Lambda expression exercise
body: <p>I have been trying to learn more about lambda expressions lately, and thought of a interesting exercise...</p>
  
  <p>is there a way to simplify a c++ integration function like this:</p>
  
  <pre><code>// Integral Function
  double integrate(double a, double b, double (*f)(double))
  {
      double sum = 0.0;
  
      // Evaluate integral{a,b} f(x) dx
      for(int n = 0 ; n &lt;= 100; ++n)
      {
          double x = a + n*(b-a)/100.0;
          sum += (*f)(x) * (b-a)/101.0;
      }
      return sum;
  }
  </code></pre>
  
  <p>by using c# and lambda expressions?</p>