function findMagicNum(numsArr, magicNum) {
  let sum = 0;
  let end = numsArr.length;

  for (let i = 0; i < end; i++) {
    for (let j = i; j < end - 1; j++) {
      sum = numsArr[i] + numsArr[j + 1];
      if (sum === magicNum) {
        console.log(numsArr[i], numsArr[j + 1]);
      }
    }
  }
}
// Write a function, which prints all unique pairs in an array of integers whose sum is equal to a given number.
Write a function, which prints all unique pairs in an array of integers whose sum is equal to a given number.
Write a function which prints all unique pairs in an array of integers whose sum is equal to a given number .
function findMagicNum(numsArr, magicNum) {
  let sum = 0;
  let end = numsArr.length;
  for (let i = 0; i < end; i++) {
    for (let j = i; j < end - 1; j++) {
      sum = numsArr[i] + numsArr[j + 1];
      if (sum === magicNum) {
        console.log(numsArr[i], numsArr[j + 1]);
      }
    }
  }
}
function findMagicNum ( numsArr , magicNum ) { let sum = 0 ; let end = numsArr . length ; for ( let i = 0 ; i < end ; i ++ ) { for ( let j = i ; j < end - 1 ; j ++ ) { sum = numsArr [ i ] + numsArr [ j + 1 ] ; if ( sum === magicNum ) { console . log ( numsArr [ i ] , numsArr [ j + 1 ] ) ; } } } }
Write a function, which prints all unique pairs in an array of integers whose sum is equal to a given number.
Write a function which prints all unique pairs in an array of integers whose sum is equal to a given number .