Wrong ans even code is producing correct ans

code is ==
#include
using namespace std;
int main() {
int r,c;
cin>>r>>c;
int arr[r][c];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
cin>>arr[i][j];
//cout<<arr[i][j]<< " β€œ;
}
}
int ci=0,cl=c-1;
int ri=0,rl=r-1;
while(ci<=cl && ri<=rl){
for(int i=ri;i<=cl;i++){
cout<<arr[ri][i]<<”, β€œ;
}
ri++;
for(int i=ri;i<=rl;i++){
cout<<arr[i][cl]<<”, ";
}
cl–;
for(int i=cl;i>=ci;i–){

cout<< arr[rl][i]<<", β€œ;
}
rl–;
for(int i=rl;i>=ri;i–){
cout<<arr[rl][ci]<<”, ";
}
ci++;
}
cout << β€œEND”;

return 0;

}

@aryanraj
Hello aryan,
please save your code on codingblocks ide and share code link

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.