#include
#include
int main(void) {
const double pi=3.14159265359;
double c, d, h, i1=0, i2=0;
int n1=10, n2=100;
printf("c = ");
scanf("%lf",&c);
printf("d = ");
scanf("%lf",&d);
h=(d-c)/n1;
for (int i=0; i i1 *= h;
printf("I1 = %.4f\n", i1);
h=(pi-0)/n2;
for (int i=0; i i2 *= h;
printf("I2 = %.1f\n", i2);
return 0;
}
Пример:
c = 2
d = 5
I1 = 4.8002
I2 = 3747660340620.0