0
Challenge question
What is the output of this code? #include <iostream> using namespace std; int main() { int x=2,y=4,z=6,q; q=(y,x,z); cout<<q; return 0; }
4 Answers
+ 1
You get answer 6.
but with a warning not error...
+ 7
Mohamad Nourigohar , you can check this easily by yourself. Put this code in playground and run it.
+ 3
Always the last value gets assigned to the variable if you are using variables in parentheses like this!
So, this means => q = z => q = 6
0
i recived an error
but in challenge it wants a num