Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3 Different Parts for C Programming. A) Write a program using array, and pass th

ID: 3804180 • Letter: 3

Question

3 Different Parts for C Programming.

A) Write a program using array, and pass the array to a function that asks user to input 5 numbers, calculates the average of those numbers, then count the total number that is greater than the average. For example, you have input 5 numbers as: 1,2,3,4,5. The average is 3. The total count above the average is 2.

B) Write a function float Average(int, int) that finds the mean, and them write a main program that inputs two numbers from the user repeatedly until the user enter “0”. You need to call the function and display the mean of two numbers in the main.

C) Given the following declaration: int a = 10; int b = 2; int *q = &a; int *p =&b;
   What is the value of each of the following expressions? For (a), (b), and (c), all variables will be set back to their original values.

a.++a;

b.++ (*q);

c.*q - *p;

Explanation / Answer

A). main.c #include /* function declaration */ double getcount(int arr[], int size); int count; int main () { /* an int array with 5 elements */ int input[5] , i ; double avg; for(i=0;i avg){ count = (int) (5 - avg); printf(" the count is = %d",count); } return 0; } avg.c: double getcount(int arr[], int size) { int i; double avg; double sum = 0; for (i = 0; i