Advertisement
CR7CR7

nested if

Sep 18th, 2022
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. let input = [
  2.   '13',
  3.   '17'
  4. ];
  5.  
  6. let print = this.print || console.log;
  7. let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  8.  
  9. let first = +gets();
  10. let second = +gets();
  11.  
  12. if (first === second) {
  13.   console.log('This two numbers are equal.');
  14. } else {
  15.   if (first > second) {
  16.     console.log('The first number is greater than the second.');
  17.   } else {
  18.     console.log('The second number is greater than the first.');
  19.   }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement