Matrix search, what is the problem in code?

#include
using namespace std;

int main() {
int t,i,j; //testcase
cin>>t;
while(t–)
{
int m,n;
cin>>m>>n;
int a[m][n];
if(m>=1 && m<=30 && n>=1 && n<=30)
{ for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
if(a[i][j]>=0 && a[i][j]<=100)
cin>>a[i][j];
}
}
int x;
cin>>x;
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{ if(a[i][j]==x)
{
cout<<‘1’<<endl;
break;
}
}
}
cout<<‘0’<<endl;
}

}
return 0;

}

Sir where am I wrong??

Plz send your code by saving on ide,

Firstly dont include the conditions of m,n and ar[i], these are unnecessary included in the code,
Also matrix search is based on the fact, that we have sorted elements in both rows and columns, thus we apply different searching mechanism like we will select any of the corner element and then compare that element with the element to be searched,
if(ar[i][j]<x)
{
i++;
}
else
{
j–;
}
where x is element to be searched