Matrix search not working for all the cases

plz find the p[roblem

@ashigupta.gupta570 you have assigned the size of array before taking the values of n and m. Also, you have to take value of n before m.
So, int a[n][m] should come after cin >> m>> n and it should cin >> n>>m instead.
And we have to take the value of x after all the elements in the 2-d matrix have been entered. So cin >> x should come after line number 16.
I have modified your code a little. Hope this helps.

thanks its done!!!

If your doubt is cleared, I request you to mark it as resolved.
Thank you.