The output is 34, but how is this expression evaluated?
How would it be with parentheses?
The correct operator precedence is:
a += ((((((2 * i++) % 5) * 4) + (--j)) - (3 / k)) + 2);
But I think correct should be:
a += (((((2 * i++) % (5 * 4)) + (--j)) - (3 / k)) + 2);
#include <iostream>
using namespace std;
int main()
{
int a = 3, i = 12, j = 14, k = 16;
a += 2 * i++ % 5 * 4 + --j - 3 / k + 2;
cout << a;
}