/* Write a complete C program that takes in three integers from the user and computes the average of the first two, the second two, and the first and third number. It then calculates the average of all three numbers. The program must take the user input as integers (not doubles) and must replicate the following sample run exactly. Note where extra spaces are included. Also note that the 'and' and 'is' in the lines for the first three averages line up. You can assume that the user will enter numbers that are in the range 0-99. ============= START OF SAMPLE RUN ======================= Enter the first number > 5 Enter the second number > 12 Enter the third number > 21 The average of 5 and 12 is 8.500. The average of 12 and 21 is 16.500. The average of 5 and 21 is 13.000. The average of 5, 12, and 21 is 12.667. ============= END OF SAMPLE RUN ======================= */ #include #include int main() { int num1, num2, num3; printf("Enter the first number > "); scanf("%d", &num1); printf("Enter the second number > "); scanf("%d", &num2); printf("Enter the third number > "); scanf("%d", &num3); printf("\n"); printf("The average of %2d and %2d is %6.3lf.\n", num1, num2, (double)(num1+num2)/2.0); printf("The average of %2d and %2d is %6.3lf.\n", num2, num3, (double)(num2+num3)/2.0); printf("The average of %2d and %2d is %6.3lf.\n", num1, num3, (double)(num1+num3)/2.0); printf("The average of %2d, %2d, and %2d is %6.3lf.\n", num1, num2, num3, (double)(num1+num2+num3)/3.0); system("pause"); }