+ 1
C++ printing output
Hello, I couldn't understand the output of code below. Can anyone give some hint? https://code.sololearn.com/cIo4s3QK7P39/?ref=app
2 Answers
+ 1
I do not understand it completely.
What I do see.
a=1,2,3,4,5; //because of the comma the compiler ignore ,2,3,4,5
a = 1
b=(1,2,3,4,5);
b=5 // the () causes the compiler to take the last value
to prove this have a look at c
c=(1,2,3,4);
c=4
I used "endl" to separate the different lines and understand that the result is not fifteen.
https://code.sololearn.com/c3UEK8nLoRRr
+ 1
Thank you, I didnt know about ignorence of comma and effect of paranthesis. Understood completely.