I don't know why the code is not working and i want to print spiral pattern

#include
using namespace std;
void spiral(int a[][100], int m, int n){
int startrow=0;
int endrow=0;
int startcol=m-1;
int endcol=n-1;
while(startrow<=endrow and startcol<=endcol){
// first row
for(int i=startcol;i<=endcol;i++){
cout<<a[startrow][i]<<" “;
}
startrow++;
// last column
for(int i=startrow;i<=endrow;i++){
cout<<a[i][endcol]<<” “;
}
endcol–;
//last row
for(int i=endcol;i>=startcol;i–){
cout<<a[endrow][i]<<” “;
}
endrow–;
// first column
for(int i=endrow;i>=startrow;i–){
cout<<a[i][startcol]<<” ";
}
startcol++;

}

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

spiral(a,m,n)

}

@vikash3303 share your code using cb ide

@vikash3303 bro lot of mistakes give double inverted commas correctly " " like this and some place writeen i- but should be i–

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.