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. | SoloLearn: Learn to code for FREE!

+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

12/21/2019 4:06:20 AM

Sumit Vajarinkar

+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.

+1

Thanks Ipang

+1

You're welcome Sumit Vajarinkar Keep it up 👍

+1

I searched it In C we solved it from right side. Is it correct? Ipang

+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.

+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 ...

+1

Ohk, so the problem will be as much correct with braces () for better understanding Ipang

+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 👌

+1

Yep, clarification must be there in code to solve in C Ipang thank you 😊

+1

You're welcome buddy 👌

+1

Am a beginner pls, how will i start?

+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

0

Mostly 90% codes this method is correct While some codes it doesn't match Ipang