What is the difference between the expressions (9*1-8) & (9-1*8)?

What is the difference between the expressions (9*1-8) & (9-1*8)?
A. Computational difference
B. Final results are different
C. No difference
D. Cannot be determined
 
Answer: a
Explanation: MATLAB follows a precedence of operators while doing any computation. So (9*1-8) is done like this: 9*1-8=9-8=9. But (9-1*8) is done like this: 9-1*8=9-8=1. Even though the answers are same, there is a computational difference between evaluation of the two expressions in MATLAB.
 

Tìm kiếm

Back
Top