% cd % cd cs21 % mkdir week5 % cd week5 % pwd /home/your_user_name/cs21/week5
% cp /home/newhall/public/cs21/week5/* .
----------------------------------------------------------------------------- | 0 | 1 | 4 | 9 | 16 | 25 | 36 | 49 | 64 | 81 | 100 | -----------------------------------------------------------------------------
Next, add code to print out the array contents.
Next, edit the printing loop in this program so that i starts at -5 and continues until 5 past the highest valid index. We would hope that when we try to compile this version of the program that we would get an error for using negative values for array indices. Unfortunately, most C compilers do not check that the array index is in bounds. Compile and run the program. What happens?