1.

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 determinedThis question was addressed to me by my school teacher while I was bunking the class.My question is from Variables and Assignments in division MATLAB Basics of MATLAB

Answer»

The correct answer is (a) Computational difference

For 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.



Discussion

No Comment Found

Related InterviewSolutions