what is wrong in my code. why am I getting zeroes in between. can you rcorrect my code.
#include
using namespace std;
int main(){
int arr[100][100],m,n;
cin>>m>>n;
for(int row=0;row<n;row++){
for(int col=0;col<m;col++){
cin>>arr[row][col];
}
}
/for(int row=0;row<n;row++){
if(row%2==0){
for(int col=0;col<m;col++){
cout<<arr[row][col]<<",";
}
}
else{
for(int col=m-1;col>=0;col–){
cout<<arr[row][col]<<",";
}
}
}
cout<<“END”;
}/
int sr=0,sc=0,er=n-1,ec=m-1;
while(sr<=er and sc<=ec ){
for(int col=sc;col<=sc;col++){
cout<<arr[sr][col]<<",";
}
sr++;
for(int row=sr;row<er;row++){
cout<<arr[row][ec]<<",";
}
ec++;
for(int col=sc;col>=sc;col–){
cout<<arr[er][col]<<",";
}
er–;
for(int row=er;row>=sr;row–){
cout<<arr[row][sc]<<",";
}
sc++;
}
}