To compile the program type "g++ -o spiral spiral.cpp". To run the program, type "./spiral".
The command line program, spiral.cpp, asks the user for a positive integer n. It then prints out an n x n array with the numbers 1 through n^2 in a spiral fashion. For example, if n=3, the output of the program is
1 2 3
8 9 4
7 6 5
If n = 4, the output of the program is
01 02 03 04
12 13 14 05
11 16 15 06
10 09 08 07