Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Arrays Matrix School Programming

Print a given matrix in spiral form

Given a 2D array, print it in spiral form. See the following examples. Examples: Input: 1 2 3 4 5 6 7 8 9 10 11 12 ...

Subscribe to Our Newsletter