12th Jul 2022, 7:07 PM
Boris Zugic
Boris Zugic - avatar
7 Answers
+ 2
It's not (int a, int b) ; it's just a sequence of instructions enclosed in a paranthesis.. Just same as comma separated instructions.. Sequentially instructions are executed each return a result into lvalue(left opearand).. Like : int num = ( 1,2,3,4,5) ; 5 is assigned into num. 1,2,3,4 are return but replaced by 5 at last. So no use of 1,2,3,4 But ( a++, ++a) here a++ executed first then ++a so it has some result produced. And last value of a is returned to lvalue....
12th Jul 2022, 8:22 PM
Jayakrishna 🇮🇳
+ 1
a=-5; (a++, ++a) ; a++ cause a = -4 ++a cause a = -3 And it is assinged to k So it output -3 Mention details about what help you need... Is this what you looking..
12th Jul 2022, 7:12 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 My question is in the code. I copied this code from a question here on SoloLearn and I was wondering what (int a, int b) operator does, or if it is an operator at all. I’ve never encountered such syntax.
12th Jul 2022, 8:10 PM
Boris Zugic
Boris Zugic - avatar
+ 1
Boris Zugic int a, int b refer to two different variables a and b of Datatype integer. In that Code could we Set the variable a as a++, and b as ++a. Also so: Int a = a++ Int b = ++a // a after a++ edit: Look bellow Jayakrishna🇮🇳 gave the answer.
12th Jul 2022, 8:21 PM
Felix Alcor
Felix Alcor - avatar
+ 1
Jayakrishna🇮🇳 Thank you very much!
12th Jul 2022, 8:48 PM
Boris Zugic
Boris Zugic - avatar
0
Boris Zugic forgotton semicolon in Line 8.
12th Jul 2022, 7:24 PM
Felix Alcor
Felix Alcor - avatar
0
You're welcome..
12th Jul 2022, 8:52 PM
Jayakrishna 🇮🇳