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(7) evaluate to?
Answers
Answered by
1
Answer:
f(7) evaluates to 21
21 is the answer.
Thank Uhhh!!! ;)
Similar questions
Math,
4 months ago
English,
4 months ago
Computer Science,
4 months ago
Math,
9 months ago
Hindi,
1 year ago