Anticloclwise_spiral_print matrix

Here is my code link “https://ide.codingblocks.com/s/338412
My logic is not working

refer to this corrected code here


i have marked the mistake along with comments