Raji Ram
Active member
Dear Prof. Sir,....... I looked at the video given in post https://www.tamilbrahmins.com/showthread.php?t=31366&p=385084#post385084. That is not the way a value of an expression is computed. The order of evaluation is always left to right according to the operator precedence......
Answers to my questions in post https://www.tamilbrahmins.com/showthread.php?t=31366&p=385150#post385150
a) 3 ( 2,3,-,4,+)
b) -5 (2,3,-4, -)
c) 256 (2,2,3,^,^) - Exponentiation (operator ^) is right associative - you go from right to left - so 2[SUP]3[/SUP] is evaluated first to 8 then 2[SUP]8[/SUP] is evaluated next to get 256. ........
Thanks for the explanation. I got the correct answers.
But, after seeing the video I thought the answer to a) and c) might be wrong!! :becky:
Hence I waited for you to reply. So, even dinosaur can do good math! :thumb:
BTW, my guess was this - confused by the video:
Answer for Q a) 2-3+4 might be 3 + 4 = 7; 2 - 7 = - 5 !! (Addition first and subtraction next - BODMAS)
Answer for Q c) might be (using the left to right rule) 2 ^ 2 = 4; 4 ^ 3 = 64 !!