0
Spiral array in C++
How to print a spiral array in C++ Something like this: 1 16 15 14 13 2 17 24 23 12 3 18 25 22 11 4 19 20 2110 5 6 7 8 9
3 Answers
+ 14
First thing which came to mind would be code written by fellow SoloLearner John Wells, proper comments included for other users like you.
https://code.sololearn.com/c8CxJboIHmAQ/?ref=app
Look up Code Playground for more examples.
+ 6
if you visualize an array as...
-->rows
| columns
v
it becomes pretty simple.