FiddleComputers

Coding interview 1 - C function

Oct 17th, 2020 (edited)
465
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int addUp(int* array, int arraySize, int k)
  2. {
  3.     for(int i = 0; i < arraySize; i++)
  4.     {
  5.         for(int j = i + 1; j < arraySize; j++)
  6.         {
  7.             if(array[i] + array[j] == k) return 1;
  8.         }
  9.     }
  10.  
  11.     return false;
  12. }
RAW Paste Data