Not able to debugg error
which question you are asking??
you have asked doubt on “arrys-spiral-print-anticlock”
but your code is not for this question
Please ask doubt on correct question
this time you can ask here as well
for rotate image(N*N)
MODIFIED CODE
i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved 
if you have more doubts regarding this feel free to ask
you have reopen your doubt
the error in your code is
at line no 11
void rotate(int a[1000],int n){
a is not 1D array it is 2D array
so correct statement is
void rotate(int a[][1000],int n){
anything which is not clear yet you can ask here
also if doubt is resolved mark it as resolved 
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.