I am trying to get use to unary operators and i found something very strange when i ran the same code in different compilers. The output was different. I used devc++ and vs-studio and both showed different outputs.
Here is my code:
#include <iostream>
using namespace std;
int main()
{
int a, b ;
a = 2;
b = ++a * ++a* (a++ * a++);
cout << b;
}
Here are the outputs of vs studio and devc++:
DEVC++ = 320
VISUAL STUDIO = 256