What is the output of the following code? [code]p=[1 3 2]; roots[p];[/code]

What is the output of the following code?
Code:
p=[1 3 2]; roots[p];
A. Syntactical Error
B. Undefined roots
C. -2,-1
D. Cannot be determined
 
Answer: a
Explanation: The input to the roots command has to be within parentheses. Here, it’s given within [] so it’ll result in a syntactical error. If the input was given within parentheses, the output would’ve been -2,-1.
 

Tìm kiếm

Back
Top