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;
}
What is the output is the question and the answer is 8 2. how is it so?