2D ARRAY Traversal

I want to use function to traverse in 2d array but it showing no error but it also doesn’t giving me any output.
using namespace std;
#include
void display(int arr[][1000],int m,int n)
{
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
cout<<arr[i][j]<<" ";
}
cout<<endl;
}
}
int main()
{
int m,n;
int arr[1000][1000]={0};
cin>>m>>n;
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
cin>>arr[i][j];
}
}
display(arr,m,n);
}

Try initialising this array outside the main function (i.e. in the global scope).

Also, consider using backticks for posting code or providing a link to some platform which formats it well. It looks pretty messed up this way.