0
int res=0; for(int i=1;i<10;i+=3) { if(10/i==2) continue; res += i; } cout<<res<<endl;
Why is output 8 ???
1 Resposta
+ 1
The i's provided by the loop conditions are 1, 4 and 7.
10/4 (int division) is 2, so that step is left out by continue.
So only 1 and 7 are added to res.
Result: 8