Back to questions
JuniorTheoryCommon
What does the program print?
Сумма = 6000;
Если Сумма > 1000 Тогда
Сообщить("скидка 5%");
ИначеЕсли Сумма > 5000 Тогда
Сообщить("скидка 10%");
Иначе
Сообщить("без скидки");
КонецЕсли;скидка 5%
- Expecting the narrower condition
Сумма > 5000to win: branches are checked in order and the first true one runs - Expecting every true branch to run: after the first true branch the rest are skipped
- How should these branches be reordered to give 10% from 5000?
- When does the
Иначеbranch run in this construct?