Matrix search not printing 0 for key not found

Matrix search not printing 0 for key not found. It is compliling sucessfully and also giving 1 for key found in a matrix.
But if a key is not present in that matrix its not printing zero
Can you tell me where am i going wrong?

the condition at line no 36
else
{
cout<<“0”;
}
will never be executed

to handle this case you have to use flag concept
initially set flag=false;
if key found update flag=true;
now outside loop flag will tell you whether key found or not;

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.