What is the output of the following code? [code]sine(pi/2)[/code]

Trường Phan

New member
What is the output of the following code?
Code:
sine(pi/2)
A. Error due to pi
B. Error due to sine
C. 1
D. Cannot be determined
 
Answer: b
Explanation: The output would’ve been 1 but the command to find the sine of an angle is sin() whereas we have added an extra ‘e’ in the above command. MATLAB won’t recognize this command and will give an error in the code.
 

Tìm kiếm

Back
Top