Back to questions
JuniorTheoryCommon
What does the program print (lines separated by spaces)?
Остаток = 10;
Продано = 0;
Пока Остаток >= 3 Цикл
Остаток = Остаток - 3;
Продано = Продано + 1;
КонецЦикла;
Сообщить(Продано);
Сообщить(Остаток);3 1
- Expecting an extra pass, as if
Покаchecked its condition after the body: the check comes before every pass, so at 1 the body does not run - Expecting
Покаto run the body once, likeЕсли: the body repeats while the condition is true
- What happens if the loop body never changes
Остаток? - What does the program print if
Остатокstarts at 2?