Printing the matrix in a spiral order
Given a two dimensional array or a matrix, how do we write a program to print the elements in a spiral order. For example the spiral order for the following matrix is 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10 1 2 3 4…