Am I wrong that the answer is 2?? Teacher refuses and says that it's 3 because the compiler spits out 3 for ans.. but if I do it manually with pen an paper or with the cout<<v2%v1++, it spits out 2 which is what I get on paper..
#include <iostream>
using namespace std;
int main()
{
int ans = 0, v2 = 8, v1 = 5;
ans = v2 % v1++;
cout<<(ans); //This prints out 3..
cout<<(v2 % v1++); //This prints out 2..
cin.get();
return 0;
}
I tried it in java and C#.. and it spits out 2 and 3.. every time..