A function is not returning values according to desired input values. What should be the correction?

A function is not returning values according to desired input values. What should be the correction?
A. Include clear all at the beginning of function file
B. Include close all at the beginning of function file
C. Include echo on in the function file
D. Cannot be solved
 
Answer: a
Explanation: Even though the variables defined within a function are local variables, they might get affected due to the previous usage. So while execution of the same function, the user might get a different answer. Thus it is advised to include clear all to remove all previous definitions of variables. The command ‘close all’ is used to clear the previously created graphs.
 

Tìm kiếm

Back
Top