/* * Camculate the values of the following integral: * * d_n = \int_0^1 e^{-x} x^n dx * * d_n > 0, monotoneously decreasing as n increasing */ #include #include int main(void) { double d = 1. - 1/M_E; // d_0 for (int i = 1; i < 24; i++) { d = -1/M_E + i*d; // d_{i} = -1/e + i* d_{i-1} printf("%5d %20.6f\n", i, d); } return 0; }