You want help with errors yet you don't use code tags and you don't tell us what the errors are. All I get when I compile are warnings that suggest inaccurate behavior. These statements:
avg[i]=n+m+p/3;
davg = sum/3;
Should be changed to this:
avg[i]=n+m+p/3.0f;
davg = sum/3.0f;
This forces the expression into the float range so that anything past the radix is not truncated as it would be using integer math.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004