+ 13

How the answer is 1 1?

See the below Screenshot. It's a challenge question. Need explaination. Here we are doing x = 8. It's mean we have assigned 8 to x then why 1 1? https://photos.app.goo.gl/jtrP9aKSvxqHazWM7

2nd Sep 2020, 3:28 PM
A͢J
A͢J - avatar
5 Answers
+ 8
if(a = 8 || b==5) Happens like if( a = (8 || b ==5)) Then a = 1 => (8 || b==5) return true. Because of associatity & Operator precedence in c++
2nd Sep 2020, 3:44 PM
Jayakrishna 🇮🇳
2nd Sep 2020, 4:22 PM
A͢J
A͢J - avatar
+ 3
1 1 because if comparison uses Boolean operators which are logical operators not integer values 🤔
3rd Sep 2020, 11:31 AM
Sanjay Kamath
Sanjay Kamath - avatar
+ 2
🎃#H P 22™🎃 This question is asked by me . If she is saying welcome on my reply then what is your problem?
11th Sep 2020, 3:54 PM
A͢J
A͢J - avatar
- 2
23 hrs
4th Sep 2020, 5:51 AM
Angel Mugisa