Help PLease

I've been completely stumped by this problem and could someone explain the step to achieve the final answer?


#include <iostream>
using namespace std;
int main()
{
int i; int j = 0;
for ( i = 0; i < 7; i++)
{

if(i % 2 == 1)
{
i = i + 2; j++;

}
else
{

j = j + 2;

}
j--;
}
cout << i <<" "<< j;
}
I've been completely stumped by this problem


What problem? That's not a problem. That's some C++ code.
What is the output is the question and the answer is 8 2. how is it so?
Topic archived. No new replies allowed.