/* File: avg1.c This program computes the average of two values. */ #include double average(double, double) ; int main() { double outerDiameter, innerDiameter ; double avgDiameter ; printf("Outer Diameter = ") ; scanf("%lf", &outerDiameter) ; printf("Inner Diameter = ") ; scanf("%lf", &innerDiameter) ; avgDiameter = average(innerDiameter, outerDiameter) ; printf("Average = %f\n", avgDiameter) ; return 0 ; } /* Calculate the average. */ double average(double value1, double value2) { double avgValue ; avgValue = (value1 + value2) / 2.0 ; return avgValue ; }