I am getting zero values ,why?

#include
using namespace std;

int
main ()
{

int n, m;
cin >> m >> n;
int arr[m][n]={0};
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
cin >> arr[m][n];

}} 

 int start_col = 0;

int start_row = 0;
int end_row = m - 1;
int end_col = n - 1;
while (start_col <= end_col and start_row <= end_row)
{
for (int i = start_col; i <= end_col; i++)
{
cout << arr[start_row][i]<<" ";

} start_row++;
  for (int i = start_row; i <= end_row; i++)
{
  cout << arr[i][end_col]<<"  ";
} end_col--;
  if(end_col>start_col)
  {for (int i = end_col; i >= start_col; i--)
{
  cout << arr[end_row][i]<<"    ";
} end_row--;}
  if(end_row>start_row)
 { for (int i = end_row; i >= start_row; i--)
{
  cout << arr[i][start_col]<<"  ";
} start_col++;}
}
 return 0;

}

I have made changes in ur code


Its working fine now. hope ur doubt is cleared.

If u still have any doubts u can msg back here

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.

i dont know how to access this doubt thing in laptop

in course there is option to ask doubt in every video and question