Finding pair of element in array

sir I tried the other method but my code is not running .Please correct it

@Megha2468,

  • Line 7: You are taking input of ‘k’ before input of array values, but not providing custom input accordingly.
  • Line 13: Your outer loot is going till i=n-3, it should go till i=n-2.
  • Line 15: Your inner loop is going till i=n-2, it should go till i=n-1.