Here is a program that computes the arithmetic-geometric mean of two numbers: #include #include int main() { double a; double b; double c; double d; int i; scanf("%lf%lf",&a,&b); for (i = 0;i < 1000;++i) { c = (a + b)/2; d = sqrt(a * b); a = (c + d)/2; b = sqrt(c * d); } printf("%lf\n",a); return 0; } Here is an incomplete second version of the program: #include #include int main() { double a; double b; double c; double d; int i; scanf("%lf%lf",&a,&b); for (i = 0;i < 1000;++i) { averages(a,b,&c,&d); averages(c,d,&a,&b); } printf("%lf\n",a); return 0; } Write an averages() function that makes the second version work just like the first.