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 = []; 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
Get step-by-step solutions from verified subject matter experts
