You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
379 B
17 lines
379 B
#include <stdio.h>
|
|
|
|
double average(double a, double b) {
|
|
return (a + b) / 2;
|
|
}
|
|
|
|
int main(void) {
|
|
double x, y, z;
|
|
|
|
printf("Enter three numbers: ");
|
|
scanf("%lf %lf %lf", &x, &y, &z);
|
|
printf("Average of %g and %g: %g\n", x, y, average(x, y));
|
|
printf("Average of %g and %g: %g\n", y, z, average(y, z));
|
|
printf("Average of %g and %g: %g\n", x, z, average(x, z));
|
|
|
|
return 0;
|
|
}
|
|
|