Question #342880

Find the error(s) in each of the following program segments and explain how the error(s) can be corrected: 

(ii) int sum(int x, int y) { int result; result = x + y; }


Expert's answer

The error: you forgot to return the result

this should be like

int sum(int x, int y) { int result; result = x + y; return result; } or int sum(int x, int y) { return x + y; }


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS