// i know this may seem like way to beginer but i need to know how to make a for loop with a mod to either add when positive or subtract when negative.
//heres what i have so far
#include<iostream>
#include<math.h>
using namespace std;
int main(){
unsigned long int pi, itteration, iResult=0;
for(int n = 0; n < 10; n++){
cout << " " << pow(static_cast<double>(-1), n) * (2*n + 1);
if(n % 2 == 0) iResult = n - iResult;
else iResult = n + iResult;
}
cout <<"\n\n";
system("pause");