Find the minimum of two numbers

Task. Were given two real numbers [latex]x[/latex] and [latex]y[/latex]. Find [latex]\min (x, y)[/latex].

Tests

Input Output
758 843 Maximum number is: 843
459 238 Maximum number is: 459

Solution

With if-statement

Code refactoring

Without if-statement

 

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

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