$$\sum_{i=1}^5 (-1)^{i+1}*i^2 $$ I thought it would be something like this but i always get 36 or -36. This is c also.
for(i = 1; i <= n; i++)
if(i++ % 2 == 0) {
count = pow(-1,n+1)*pow(n,2);
} else{
count = pow(-1,n+1)*pow(n,2);
}