What are the contents of a after the following events? [code]Line 1: function p=avg(x) Line 2: n = length(x); Line 3: n=n+3 Command Window:

What are the contents of a after the following events?
Code:
Line 1: function p=avg(x)
Line 2: n = length(x);
Line 3: n=n+3
Command Window: 
>> x=[1 2 3 4 5]
>> dbstop in avg if length(x)>4
>> a=avg(x)
A. 8
B. Enters debugging mode after execution of the last line
C. Enters debugging mode at the first line only
D. Enters debugging mode at the 2$^{nd}$ line
 
Answer: c
Explanation: We haven’t mentioned the line no. where the debugging mode should begin if the condition provided with the dbstop command is unsatisfied. Hence, debugging will start at the first line only.
 

Tìm kiếm

Back
Top