Can someone tell me how the following code is executed?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone tell me how the following code is executed??

int i=1,j=2,k=3; int w=(i,j,k); cout <<w; output is 3.

16th Mar 2017, 6:38 AM
Aalekh Jain
Aalekh Jain - avatar
1 Answer
+ 4
"i" is assigned the last value that is 3. I guess it first is assigned 1, then reassigned to 2 and finally to 3.
18th Jun 2018, 6:27 PM
Adam Aksu
Adam Aksu - avatar