Answer the question
In order to leave comments, you need to log in
How to find the value of this mathematical expression?
For example, if N = 6
How to describe the arithmetic in detail?
see picture
Answer the question
In order to leave comments, you need to log in
something like this:
int foo(int n)
{
int sign =1;
int sum = 0;
for(int i = 0; i <= n; i++)
{
sum += sign * (2 * i + 1);
sign *= -1;
}
return sum;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question