Spiral print clockwise

which test case fails

#include
using namespace std;

void spiralprint(int a[10][10],int m,int n){
int sc=0,sr=0,ec=n-1,er=m-1;
while(sr<=er && sc<=ec){
for(int col=sc;col<=ec;col++){
cout<<a[sr][col]<<", “;
}
sr++;
for(int row=sr;row<=er;row++){
cout<<a[row][ec]<<”, “;
}
ec–;
if(sr<er){
for(int col=ec;col>=sc;col–){
cout<<a[er][col]<<”, “;
}
er–;
}
if(sc<ec){
for(int row=er;row>=sr;row–){
cout<<a[row][sc]<<”, ";
}
sc++;
}
}
cout<<“END”;
cout<<endl;
}
int main() {
int m,n;
cin>>m>>n;
int a[10][10];
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
cin>>a[i][j];
}
}
spiralprint(a,m,n);
return 0;
}

Please tell me asap.

these condition are not complete
correct is

if(sc<=ec){
if(sr<=er){

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.