Between two values

Task

Were given three real numbers x, y, z. Check whether the inequality [latex]x < y < z[/latex] is correct. If it is correct, show as an result the word «true». If it is not correct, show as an result the word «false».

Tests

Input Output
8 9 25  true
9 25 8 false
8 25 9  false
9 8 25  false
25 8 9  false
25 9 8  false

Solution

With «if» statement:

Code refactoring

 

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *