OR 11

¡Supera tus tareas y exámenes ahora con Quizwiz!

Given the following while loop, what is the value assigned to variable z for the given values of variables a, b and c? mult = 0; while a < 10 mult = b * a if mult > c break; end a = a + 1 end z = a a = 1, b = 1, c = 0

1

Given the following code, how many times will the fprintf statement execute? i1 = 0; while (i1 < 3) i2 = 1; while (i2 <= 7) fprintf('%d%d ', i1, i2); i2 = i2 + 2; end i1 = i1 + 1; end

12

What is the output of the following code? i1 = 1; while (i1 < 19) i2 = 3; while (i2 <= 9) fprintf('%d%d ', i1, i2); i2 = i2 + 3; end i1 = i1 + 10; end

13 16 19 113 116 119

Given the following while loop, what is the value assigned to variable z for the given values of variables a, b and c? mult = 0; while a < 10 mult = b * a if mult > c break; end a = a + 1 end z = a a = 4, b = 5, c = 20

5

Given the following code, how many times will the fprintf statement execute? i1 = 1; while (i1 < 19) i2 = 3; while (i2 <= 9) f printf('%d%d ', i1, i2); i2 = i2 + 3; end i1 = i1 + 10; end

6

for index = 1:5 if index< 10 continue else disp(index) end end The loop will iterate only once.

False

for index = 1:5 if index< 10 continue else disp(index) end end The loop will print at least some output.

False


Conjuntos de estudio relacionados

ENTR 3012 Intrapreneurship Test 1 (Cabral)

View Set

Possible Multiple Choice Question

View Set

Chapter 17: Physical Development in Late Adulthood

View Set

GFE - Components - Sensors and Detectors (291002)

View Set

Midterm Review, Midterm short response review

View Set

CSIS 161 week 2 Practice Questions

View Set