14th Mar 2021, 3:54 PM
Тимур Завьялов
Тимур Завьялов - avatar
9 Respostas
+ 6
Because (10 == 20) is false so (a == b) will give 0 so b = a + b + 0 = 10 + 20 + 0 = 30
14th Mar 2021, 4:05 PM
A͢J
A͢J - avatar
+ 4
After putting the values of *a* and *b* which is initially 10 and 20 respectively The statement :- b=a+b-(a==b) Becomes b = 10 + 20 - (10==20) As 10==20 is false so will return 0 b = 10 + 20 - 0 b = 30 but the question is why do you think the answer should be 20 ?
14th Mar 2021, 3:57 PM
Arsenic
Arsenic - avatar
+ 3
How 10 == 20 is 10? Do you know double equal is used for comparing values?
14th Mar 2021, 4:07 PM
A͢J
A͢J - avatar
+ 2
Ok No problem it happens when you learn something new. Хорошо, нет проблем, это случается, когда узнаешь что-то новое.
14th Mar 2021, 4:16 PM
A͢J
A͢J - avatar
+ 1
I got it. I think 10==20 is 10 and b = 10 + 20 - 10
14th Mar 2021, 4:04 PM
Тимур Завьялов
Тимур Завьялов - avatar
+ 1
I Am AJ, thank you. I confused with assignment("=")
14th Mar 2021, 4:15 PM
Тимур Завьялов
Тимур Завьялов - avatar
+ 1
Thank you, good luck!
14th Mar 2021, 4:19 PM
Тимур Завьялов
Тимур Завьялов - avatar
0
Maybe you add a as 10, b as 20, and the problem is a + b which pops up 30.
16th Mar 2021, 12:56 PM
DrNefardio
DrNefardio - avatar