int x;
x= a>b>c;
// Compiler, pops 0
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Oct 9, 2014, 6:18 AM
Sometimes it will return 1; for example if a =2, b = 1, c = 0.
It's executed as if it were written:
x = (a > b) > c;
The bracketed expression returns 1 (for true) if a > b or 0 (for false) if a <= b.
This result is then compared with c using the same principles.
So for the above values of a, b and c, we have:
2 > 1 => true => returns 1
1 > 0 => true => returns 1
If we'd had a = 0, b = 1, c = 2, the result would have been 0 as follows:
0 > 1 => false => returns 0
0 > 2 => false => returns 0
Munesh SharmaPosted Oct 9, 2014, 6:21 AM
you also have to assign datatype for a,b,c
this expression will start from left side.
Vipul explain it better by using a example
u can understand batter these expression type question from this site
http://www.indiabix.com/c-programming/expressions/