How do I print a 5×5 two-dimensional array in spiral order?
Is there any formula so that I can print an array of any size in spiral order?
How do I print a 5×5 two-dimensional array in spiral order?
Is there any formula so that I can print an array of any size in spiral order?
This is exactly what you are asking for:
http://haroonsaeed.wordpress.com/2005/09/01/printing-an-array-in-spiral-order/
Check this out for a comprehensive walkthrough...
http://2600hertz.wordpress.com/2010/03/20/the-mystery-spiral/