Answer to Question #342880 in C++ for Padi

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; }


1
Expert's answer
2022-05-23T13:26:53-0400

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS