Computer Science, asked by dokesumit73, 8 months ago

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 anindyaadhikari13
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