Wednesday, September 25, 2019

C++: Print a Matrix in Spiral Form

We are given a matrix of any dimension, say 3x3, 4x4 or 4x3, and we are required to print the elements of the matrix in spiral form.


Output: 1 2 3 4 8 12 11 10 9 5 6 7

No comments:

Post a Comment