FiddleComputers

Coding interview 1 - C function

Oct 17th, 2020 (edited)
612
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×