problem link:
Discuss: if you know the 2D. then the problem may pretty for you. how i did it first calculate all corner index value.then just increase the value of i and j. and you may trouble how to choose the corner point as it change then use them and analyse ara[i][j], ara[j][n-1-i], ara[n-1-i][n-1-j], ara[n-1-j][i] first traverse till n/2 and second loop traverse till n-1-i; examine it . it traverse all the square of the grid. then just print it..
try yourself, before see the code
Discuss: if you know the 2D. then the problem may pretty for you. how i did it first calculate all corner index value.then just increase the value of i and j. and you may trouble how to choose the corner point as it change then use them and analyse ara[i][j], ara[j][n-1-i], ara[n-1-i][n-1-j], ara[n-1-j][i] first traverse till n/2 and second loop traverse till n-1-i; examine it . it traverse all the square of the grid. then just print it..
try yourself, before see the code