What is the output of the following code? [code]format bank sym(sqrt(3))[/code]

What is the output of the following code?
Code:
format bank
sym(sqrt(3))
A. 1.72
B. 1.73
C. 3$^{(1/2)}$
D. sqrt(3)
 
Answer: c
Explanation: sym is used to represent the input arguments of the command in a symbolic form. Hence, MATLAB won’t evaluate the value of the square of 3. It will represent it symbolically as 3$^{(1/2)}$.
Output >> format bank
>> sqrt (3)
Ans = 1.73.
 

Tìm kiếm

Back
Top