Объяснение:
1. x = 0; y = 4
Цикл по i от 3 до 6
1) i = 3
x = x + 1 = 0 + 1 = 1
y = y + 2 = 4 + 2 = 6
2) i = 4
x = x + 1 = 1 + 1 = 2
y = y + 2 = 6 + 2 = 8
3) i = 5
x = x + 1 = 2 + 1 = 3
y = y + 2 = 8 + 2 = 10
4) i = 6
x = x + 1 = 3 + 1 = 4
y = y + 2 = 10 + 2 = 12
Конец цикла
y = y - x = 12 - 4 = 8
x = x + y = 4 + 8 = 12
Вывод y = 8
2. x = 0; y = 2
Цикл, пока y < 15
1) x = x + 1 = 0 + 1 = 1
y = y + 2 = 2 + 2 = 4 < 15
2) x = 1 + 1 = 2
y = 4 + 2 = 6 < 15
3) x = 2 + 1 = 3
y = 6 + 2 = 8 < 15
4) x = 3 + 1 = 4
y = 8 + 2 = 10 < 15
5) x = 4 + 1 = 5
y = 10 + 2 = 12 < 15
6) x = 5 + 1 = 6
y = 12 + 2 = 14 < 15
7) x = 6 + 1 = 7
y = 14 + 2 = 16 > 15
y = y - x = 16 - 7 = 9
x = x + y = 7 + 9 = 16
Вывод y = 9
3. x = 0; y = 5
Цикл с постусловием
y = y + 2 = 5 + 2 = 7
Выйти из цикла, если y > 15
y = 7 < 15
y = 7 + 2 = 9 < 15
y = 9 + 2 = 11 < 15
y = 11 + 2 = 13 < 15
y = 13 + 2 = 15
15 не больше 15, поэтому продолжаем.
y = 15 + 2 = 17 > 15
Выход из цикла
y = y - x = 17 - 6 = 11
x = x + y = 6 + 11 = 17
Вывод y = 11
Объяснение:
1. x = 0; y = 4
Цикл по i от 3 до 6
1) i = 3
x = x + 1 = 0 + 1 = 1
y = y + 2 = 4 + 2 = 6
2) i = 4
x = x + 1 = 1 + 1 = 2
y = y + 2 = 6 + 2 = 8
3) i = 5
x = x + 1 = 2 + 1 = 3
y = y + 2 = 8 + 2 = 10
4) i = 6
x = x + 1 = 3 + 1 = 4
y = y + 2 = 10 + 2 = 12
Конец цикла
y = y - x = 12 - 4 = 8
x = x + y = 4 + 8 = 12
Вывод y = 8
2. x = 0; y = 2
Цикл, пока y < 15
1) x = x + 1 = 0 + 1 = 1
y = y + 2 = 2 + 2 = 4 < 15
2) x = 1 + 1 = 2
y = 4 + 2 = 6 < 15
3) x = 2 + 1 = 3
y = 6 + 2 = 8 < 15
4) x = 3 + 1 = 4
y = 8 + 2 = 10 < 15
5) x = 4 + 1 = 5
y = 10 + 2 = 12 < 15
6) x = 5 + 1 = 6
y = 12 + 2 = 14 < 15
7) x = 6 + 1 = 7
y = 14 + 2 = 16 > 15
Конец цикла
y = y - x = 16 - 7 = 9
x = x + y = 7 + 9 = 16
Вывод y = 9
3. x = 0; y = 5
Цикл с постусловием
1) x = x + 1 = 0 + 1 = 1
y = y + 2 = 5 + 2 = 7
Выйти из цикла, если y > 15
y = 7 < 15
2) x = 1 + 1 = 2
y = 7 + 2 = 9 < 15
3) x = 2 + 1 = 3
y = 9 + 2 = 11 < 15
4) x = 3 + 1 = 4
y = 11 + 2 = 13 < 15
5) x = 4 + 1 = 5
y = 13 + 2 = 15
15 не больше 15, поэтому продолжаем.
6) x = 5 + 1 = 6
y = 15 + 2 = 17 > 15
Выход из цикла
y = y - x = 17 - 6 = 11
x = x + y = 6 + 11 = 17
Вывод y = 11