Help rahul to search problem

https://ide.codingblocks.com/s/53145

sir the code is showing correct output for only 1 test case, and showing run-error for 2nd test case. wht is the error ?

You are making 2 mistakes:

  1. size of array declared is 100 only, declare it as dynamic : arr[N]
  2. Passing as function arguments, to pass array we don not specify the length of the array
    i.e arr[] // correct way to pass
    int searchIn(int ar[],int start,int end,int key)

hit like if you get it!
Happy Coding :smiley:

1 Like