I am facing problems in understanding the increment orders in C++.
I am aware that increments are unary operators thus they come after parenthesis from right to left.
My question is when do we increase the number?
Here is a simple code:
#include <iostream>
using namespace std;
int main()
{
int a1;
int a(12),b(3);
a1=7+10%3-5;
b=a/b++;
cout<<a1<<"\t"<<b<<endl;
return 0;
}
Here I get a=3 that's right but b=5 , I think it is 3 because we start from the right and increase by 1 then 12/4 gives 3.