Could someone please tell us what is wrong with this question?😂 | Sololearn: Learn to code for FREE!


Could someone please tell us what is wrong with this question?😂

7/19/2020 12:27:23 PM


11 Answers

New Answer


MiKoLa🔥3L17.4L16.2.5k=>L18.🙏IDLE Answer might be same but people might not really know how it is really parsed and evaluated? 1 and 0 or 1 is parsed as (1 and 0) or 1 due to higher precedence of and lhs of or = (1 and 0) = 0 so you have 0 or 1 since lhs is 0 rhs is evaluated which gives 1 1 or 0 and 0 is parsed as 1 or (0 and 0) lhs of or = 1 and rhs = (0 and 0) due to higher precedence of and since lhs is 1, rhs is never evaluated and your final answer is 1


Answer will be 1 only! Did you get it wrong? Ohhh!! Now I understood what you wanted to say!! If a person doesn't know that 4 is not less than 3, then also he/she can get the correct answer! 😂😂😂😂😂😂 ~ swim ~ Paul Jacobs he is not having a conceptual problem! He is just saying that both the cases will give the same output then what's the point of if else statement


Namit Jain The example is simply checking the knowledge of logical "and" and "or" operator and their precedence. Rest everything is for confusion.


~ swim ~ , here is my thought on the matter , please 🙏😂


Yes, this question is going for else condition as 3 is less than 4 and condition under else will result in 1

+5 'and' goes before 'or'. Think that is part of the solution.


madeline I think 'or' has more precedence than 'and' Sonu Kittu MiKoLa🔥3L17.4L16.2.5k=>L18.🙏IDLE already knows that 😅😅😂😂 See his profile! You will be impressed by his work!


MiKoLa🔥3L17.4L16.2.5k=>L18.🙏IDLE Nothing wrong with the question. What do you think is wrong?


Answr will be one just remeber that order of evalution i.e "not and or " order of evaluation




This should be 0, I thinks so