Spiral matrix traversal

it is showing wrong answer
https://ide.codingblocks.com/s/49566

Hey Aastha, there are many errors in your code, i guess you are getting confused between m and n where m is no. of rows and n is no. of cols, but you have used them interchangeably. for eg.
in line: 18 you are looping over rows but written the termination condition of for loop as i<n
similarly in line:21, and in for loop starting at line:30.
Here I am sharing my code with you can refer this.