0
C++
Ok whats the output of this Int x=5 Result=x++*++x; Cout<<x Cout<<result
1 Answer
+ 2
That code has errors and won't compile, but this will.
#include <iostream>
using namespace std;
int main() {
int x=5;
int result=x++*++x;
cout<<x<<endl;
cout<<result;
return 0;
}
In SL playground this will output;
7
35
But the output of this code is undefined between different compilers based on how the compilers operator precedence works etc. The result could just as easily been.
7
30
or
7
36



