What is the output of the following code? [code]system('cd')[/code]

Giao Linh

New member
What is the output of the following code?
Code:
system('cd')
A. Shows the current directory
B. Shows the directory where MATLAB is located
C. Error
D. The function doesn’t exist
 
Answer: b
Explanation: cd is an OS command. The system command runs OS commands which are supported by the System. If we type ‘cd’ in Command Prompt, we get to know the current directory i.e. the path in the system where our control is currently present. Hence, here also, the current directory is shown.
 

Tìm kiếm

Back
Top