I think you need to reread about arrays.
http://www.cplusplus.com/doc/tutorial/arrays/
"The elements field within brackets [] which represents the number of elements the array is going to hold, must be a constant value, since arrays are blocks of non-dynamic memory whose size must be determined before execution. In order to create arrays with a variable length dynamic memory is needed, which is explained later in these tutorials."
Maybe about simple sequences as well.
You have a nonconforming compiler mixed with undefined behavior.
Line 12 shouldn't be a legal statement. You can only declare a static array with a constant value.
Next up, step through that program yourself, line by line. What size does
a
start as? If you answered whatever the user enters, you're wrong. You declare and size the array before you get user input.
What actually happens? The size of the array at the start is dependent on how your compiler implements it, it could choose to give uninitialized variables a default value of 0, or it can just as well leave whatever is in memory there, and not touch it at all, x is equal to an unknown amount depending on what was last using that memory location.
At either rate, if it's 0, you step out of bounds immediately, and you need to go forward 4156 * sizeof(int) bytes before you hit critical memory and crash the program, or you declare an amount of memory that is less then 4156 * sizeof(int) bytes, and still step out of bounds and crash the program.