when running the code below
int [] a = {1,2,3,4,5};
int i = -1;
while (i < a.Length)
{
i++;
Console.Write(a[i]);
}
I get this error: IndexOutOfRangeException was unhandled
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in ConsoleApplication2.exe
Additional information: Index was outside the bounds of the array.