Question: In the following code: n = 4; s = 5; z = []; for k = 1:n z(k) = s*k; end; disp(z) The for loop

 In the following code: n = 4; s = 5; z

In the following code: n = 4; s = 5; z = []; for k = 1:n z(k) = s*k; end; disp(z) The for loop runs till s = K The for loop runs n*(n+1) times The for loop runs n times The for loop runs n-1 times In the following code: n = input('Number of terms?'); for k = 1:n; for s = 1:n; z = (s-1)/(k^2); end; end; disp( squareroot (6*z)) The for loop runs n (n+1) times The for loop runs n*n times The for loop runs till s = k The for loop runs n*(n-1) times

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!