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

Hey guys I am just learning c programming and I am having a test and the teacher

ID: 3620806 • Letter: H

Question

Hey guys I am just learning c programming and I am having a test and the teacher gave us a question to try and I very stuck.

I have to design a program Function that will ask the user for as many integers as they want, but will stop when they put 0.

The prototype is int count( int *sumOdd, Int *sumEven, Int *largest);

conditions:
1. It ignores all negative numbers
2. It sums all the odd and even numbers separately
3.It finds the largest number entered.

In the end it will return the total number of integers entered excluding 0.

when that function is complete we make another function called:
void printresult(int tot, int sum1, int sum2, int max);

This function prints out everything done in the first function.

Then we call both functions in the main and here is what prints

sample output when put in main program:

number:2
number:9
number:-12
number:8
number:25
number:44
number:0

Summary:
You entered 6 numbers(excluding 0)
the sum of all even is 54
the sum of all od is 34
the largerst number is 44

If anyone can plz help me with this I would really appreciate it.

Explanation / Answer

please rate - thanks your even sum is incorrect