Searching element in a matrix

one of the test case is not working what am I missing

Your code is failing for this case:
1 6
18 21 27 38 55 67
55

Cross check it. In the function, j must be initialized to m-1 instead of n-1

yes i am getting an error on paasing 4 arguments in the function
why is it so?

Check now.

1 Like

ya corrected it thnx what if we dont write the arguments while printing the output like
cout<<search instead of cout<<search(a,n,m ) will it still work and if not why?

It will not work. The arguments must always match, else function could not be called.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.