Write a program that computes an approximation of a definite integral for the functions f(x) = e^(-x^2) and f(x) = e^(-x) with a = 0 and b = 1. The program shoulduse the trapezoidal integration rule:
where N is a positive integer and:
h = (b-a) / N
The program should include a function "trapeze" that computes and returns the value of the integral of a function passed as a parameter. Other parameters of"trapeze" are the bounds a and b and the number of intervals N. The program should read the value of N from input as in the example below.
Your program should reproduce the following format [THIS IS AN EXAMPLE OUTPUT]
Enter the number of intervals: 20
integral of exp(-x*x): 0.746671
integral of exp(-x): 0.632252