0
Explain this Please. Why answer is 1211? (C++)
#include <iostream> using namespace std; int main() { int x=1,y=1,z=1; cout <<(++x||++y&&++z); cout <<x<<y<<z; } answer: 1211
4 Réponses
+ 3
because of the || or. It is finding no reason not to perform your first operation. change || to && also and watch then. Remember it won't make a choice just because you said ||. it will still use the first valid operation it will not randomly decide to evaluate ++y and skip ++× on its own.
0
Just trying around.
https://code.sololearn.com/cDSmQnVFwU93/?ref=app
0
Thanks for answer.
Question is why y and z is not increesing?
Why answer is not 1222?