Answer:
See Explanation
Step-by-step explanation:
1. See Attachment 1 (image file) for flowchart
2. & 3. See Attachment 2 for source file (Note that I've made some corrections on the source code)
4. What makes the outputs (a and b) to be different is that;
a calculates the average of the given parameters as a = (ni+n2+n3+n4)/4
While
b calculates a different expression = (ni+n2+n3+04)/4
They will only have the same output if n4 = 4