0
Help in output
C problem anyone please explain me this output https://www.sololearn.com/post/224346/?ref=app
7 ответов
+ 2
Jun Min Suk I
Let x = 10, y = 20 and z = 5
x < y < z is evaluated left to right here, because the two operator are the same ( '<' less than operator ). Had they been different, operator precedence and/or associativity matters.
x < y < z
First x < y is processed, and then the result will be compared against z. In the following example I put parentheses to emphasize the prioritized subexpression.
( x < y ) < z
(10 < 20) < 5
// 10 < 20 => true (1)
(1) < 5
// 1 < 5 => true (1)
1 // final result
P.S. Please specify a relevant language (C apparently) in your tags 👍
Hth, cmiiw
+ 1
Can you check if ita working now
Ipang
+ 1
Okay i will be careful next time thank you i understand it
0
Jun Min Suk I
Please move post link into the question Description. Links doesn't work if you put them in the question title or tags. Put relevant language in the tags instead 👍
0
Sorry i dont know how to drag
0
Thank you for understanding Jun Min Suk I 🙏
0
I think ans.should be 0
Because no mathematical meaning in i=x<y<z this equation
with your input