Question: Here's the assignment: Write a program that reads in five values, all integers, and prints the sum and the average (a real number) of these

Here's the assignment: Write a program that reads in five values, all integers, and prints the sum and the average (a real number) of these five numbers. Prompt the user for each number and make sure your print statements identify what the output actually is. Your prompt can be very simple, something like Enter a number and your print statements can be brief, as in the sum is xxx and the average is yyy

This is what I have so far :

#include int main (void){ int num_1; int num_2; int num_3; int num_4; int num_5; printf("Enter number 1: "); scanf("%d", & num_1); printf("Enter number 2: "); scanf("%d", & num_2); printf("Enter number 3: "); scanf("%d", & num_3); printf("Enter number 4: "); scanf("%d", & num_4); printf("Enter number 5: "); scanf("%d", & num_5); int Total; int (num_1 + num_2 + num_3 + num_4 + num_5)= Total; double Average = Total / 5; printf("Average: "); scanf("%d", & Average); return 0; }

I think there is a problem with the line in which i'm adding together the number variables. Any help is appreciated.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!