22nd Nov 2018, 12:47 PM
Md. Asiful Hoque Prodhan
Md. Asiful Hoque Prodhan - avatar
2 Respuestas
+ 5
Lets suppose a = 2 b = 4 b = a + b - ( a = b); a = 2 b = 4 So first parenthesis b = a + b - ( 4) a = 2 b = 4 The value of 'a' will change because of ( a =b) after finishing the operation. now a+ b b = 2 + 4 - 4 b = 6 - 4 a = 2 b = 4 Finishing b = 2 a = 4 // remenber ( a = b) effect occurs here b =2
22nd Nov 2018, 1:04 PM
Anya
Anya - avatar
+ 1
consider the following user input a=5 and b=6 first the value will be substituted in the expression b=a+b-(a=b): b=5+6-(a=6)//here variable a now holds 6 because of assignment operation Now for b b=5+6-6=5//here variable b holds the value 5
22nd Nov 2018, 1:15 PM
Rishi Anand
Rishi Anand - avatar