ybakun

2021/07/20 Yuliia Bakun MaxNumber

Jul 20th, 2021
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. // Max number
  2. // https://zero.p2p.shpp.me/tasks/5_1_func_get_max_number.html
  3.  
  4. function max(x, y) {
  5.     if (x > y) {
  6.         return x;
  7.     } else {
  8.         return y;
  9.     }
  10. }
  11. let firstNumber = +prompt("введи перше число");
  12. let secondNumber = +prompt("введи друге число");
  13. console.log(max(firstNumber, secondNumber));
  14.  
Advertisement
Add Comment
Please, Sign In to add comment