Test case 1 isn't being fullfilled can you take a look at my code and tell the mistakes

#include
using namespace std;
int main() {
int n , m, row, col;
cin>>n>>m;
int a[10][10];
for(row=0;row<n;row++)
{
for(col=0;col<m;col++)
cin>>a[row][col];
}
int sc=0;
int ec=m-1;
int sr=0;
int er=n-1;
while(sr<=er and sc<=ec){
for(col=sc;col<=ec;col++){
cout<<a[sr][col]<<", ";}
sr++;

for(row=sr;row<=er;row++){
    cout<<a[row][ec]<<", ";}
    ec--;

for(col=ec;col>=sc;col--){
    cout<<a[er][col]<<", ";}
    er--;

for(row=er;row>=sr;row--){
    cout<<a[sc][row]<<", ";}
    sc++;

}
cout<<"END";
return 0; }

hi @abhigyankumar09 buddy refer

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.