As far as I could understand your question, following 2 probabilities could exist:
1. While iterating in for loop, as soon as you reach i = 50 you get some exceptions that remains unhandled and crashes your application.
In this case best thing is to find out why you are getting that exception. Looking at exception message, and stack trace would be helpful. If at all you can't stop the exception from being raised, you must enclose your code in try catch as below:
for(i=0; i<100;i++)
{
try{
}
catch(Exception ex)
{
}
}
2. If you have declared I as some array and if you are getting error in I[50] , then most probably length of I is limited to 50 (until and unless you have written your own indexer, which in your case has lowest probability in my opinion).
So you can not get 51st element.
Please confirm that you are getting exception that says something like "Index out of range".
In this case if you want to get to 100 elements then you write something like:
int I =new int[100]
and then iterate on I.