Index was out of range. Must be non-negative and less than the size of the collection.

Index was out of range. Must be non-negative and less than the size of the collection.

Hi, am getting Index out of range error, p

Please help me

int index = 1;
int[] numArray = new int[num2];
for (int i = num1; i <= num2; i++) {
 numArray[index] = i;
Console.WriteLine(" index: {0} assignment: {1}", index, i); index++;
Console.WriteLine("index: {0}", index);
}

Answers (0)

Submit your Answer

Registred Members are allowed post Answers. Click here to Sign-In | Sign-Up Now!

Related Forums