Regarding spiral print

In my course there is a programme to make spiral print of 2d array clockwise 90 degree.
My doubt is that during the 2nd time execution of while loop how the 3rd number for loop be executed even its condition of if(endrow>startrow) is not truehttps://ide.codingblocks.com/s/439591

Hello @sarthak_singhal i didnt understand about which part you are talking.

@sarthak_singhal i think you are talking about this:
and at that time this condition is valid in this way;
startrow is: 2 startcol is: 1endrow is:2endcol is: 1
10

@sarthak_singhal in this program i have given you the output according the conditions.