/* * CISC105-12 class * 06.06.05 * average.c * Compute the average of three numbers. * - modified 06.13.05 to accept user input. */ #include int main() { int x = 4, y = 90, z = 100; int sum; double average; printf("Enter 3 numbers: "); scanf("%d%d%d", &x, &y, &z); /* this is the sum of x, y, and z */ sum = x + y + z; /* I made the divisor 3.0 to do double division instead of integer division.*/ average = sum/3.0; printf("The average of %d, %d, %d = %lf\n", x, y, z, average); return 0; }