+ 1
Why 13 ?
Hello friends, can someone please explain me why the output of this code is 13 ? #include <iostream> using namespace std; int main() { int x=5,i; i=++x+x++; cout<<i; return 0; } thank you !
2 Respostas
+ 5
x is 5
(++x) x is 6 in this operation and next
+( x++) and x will be 7 AFTER the operation and next
so its like ++5+6++.
just check postincrements and the before increments
+ 1
thanks 👍