the following code: int f (int n) { int ans = 0; for (int i = 1; i < n; i++) { if (i < n/2) { ans -= i; } else { ans += i; } } return ans; } What does f(5) evaluate to? Hint: don't forget that dividing integers results in an integer answer. For example, 9/4 = 2.
Answers
Answered by
33
Answer:
See this. There are two attachments.
Explanation:
I hope this will help you..Please mark this answer as the brainliest.
Attachments:
Similar questions
Math,
4 months ago
Social Sciences,
4 months ago
English,
8 months ago
Social Sciences,
8 months ago
Math,
11 months ago
Social Sciences,
11 months ago
CBSE BOARD X,
11 months ago