Back to questions
JuniorTheoryCommon
What does the program print (lines separated by spaces)?
Функция Скидка(Сумма)
Если Сумма > 1000 Тогда
Возврат 50;
КонецЕсли;
КонецФункции
Сообщить(Скидка(2000));
Сообщить(Скидка(500) = Неопределено);50 Да
- Expecting a function without
Возвратto return0: when it reachesКонецФункцииit returnsНеопределено - Expecting the compiler to demand
Возвратon every branch: the module compiles, and the missing branch givesНеопределено
- How would you rewrite
Скидкаso that every branch returns a number? - What happens if a procedure is used inside an expression?