+ 1

Ans. comes D if we solve by right side & if we solve by left side it comes out C SEE THE CODE BELOW. Please explain in brief.

https://code.sololearn.com/caFJayraSM6Q/?ref=app

21st Dec 2019, 4:06 AM
Sumit Vajarinkar
Sumit Vajarinkar - avatar
13 Answers
+ 3
Review the lesson on conditional chapter please. This is C not Python if(a < b < c) Is different with if(a < b && b < c) Once you understand how each of the above expressions were evaluated, you'll get the idea about the output.
21st Dec 2019, 4:14 AM
Ipang
+ 1
Thanks Ipang
21st Dec 2019, 4:21 AM
Sumit Vajarinkar
Sumit Vajarinkar - avatar
+ 1
You're welcome Sumit Vajarinkar Keep it up 👍
21st Dec 2019, 4:50 AM
Ipang
+ 1
I searched it In C we solved it from right side. Is it correct? Ipang
21st Dec 2019, 4:51 AM
Sumit Vajarinkar
Sumit Vajarinkar - avatar
+ 1
Show me what you found Sumit Vajarinkar I'm not sure if it works out that way, but if there's a proof to it, then good.
21st Dec 2019, 5:00 AM
Ipang
+ 1
Sumit Vajarinkar I lost you at the "90% codes this method is correct" I don't get what you mean. My idea of the evaluation: if ( (a < b) < c ) if ( (40 < 20) < 80 ) if ( ( 0 ) < 80) ) If ( 1 ) But considering C doesn't support operator chaining like Python, I don't have any guarantee. Multiple expression should have explicit intermediary operator in between to be clearly readable and safe. if ( a < b && b < c ) if ( a < b || b < c ) Something like that ...
21st Dec 2019, 5:27 AM
Ipang
+ 1
Ohk, so the problem will be as much correct with braces () for better understanding Ipang
21st Dec 2019, 5:49 AM
Sumit Vajarinkar
Sumit Vajarinkar - avatar
+ 1
I only added the parentheses to emphasize/clarify the priority for evaluation buddy. I am not supporting nor encouraging such way of writing expression, it is okay if you do that in Python, but there are differences in C. If possible, just don't write that way in C 👌
21st Dec 2019, 5:54 AM
Ipang
+ 1
Yep, clarification must be there in code to solve in C Ipang thank you 😊
21st Dec 2019, 5:57 AM
Sumit Vajarinkar
Sumit Vajarinkar - avatar
+ 1
You're welcome buddy 👌
21st Dec 2019, 5:58 AM
Ipang
+ 1
Am a beginner pls, how will i start?
23rd Dec 2019, 1:36 AM
Matthew Ochiwu
Matthew Ochiwu - avatar
+ 1
First of all, 1. Start with C programming. 2. Get knowledge as well as logic of maths. 3.Solve C tutorial of C programming, varnish your knowledge through it. 4.Then, try to solve challenges on sololearn, hackerearth and so many platforms. #happy_coding 😊👍 Matthew Ochiwu
23rd Dec 2019, 2:24 AM
Sumit Vajarinkar
Sumit Vajarinkar - avatar
0
Mostly 90% codes this method is correct While some codes it doesn't match Ipang
21st Dec 2019, 5:14 AM
Sumit Vajarinkar
Sumit Vajarinkar - avatar