can you please check my code im not getting the ouput
#include
using namespace std;
int main(){
int m, n;
cin>>m>>n;
int arr[n][n];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin>>arr[i][j];
}
}
int key;
cin>>key;
int i=0;
int j=n-1;
while(i<n && j>=0){
if(arr[i][j] == key){
cout<<" element found at the index"<<i<<" "<<j<<" ";
}
if(arr[i][j]>key){
j--;
}
else {
i++;
}
}
}