u may use like
for(int i1=0; i1<n1;i1++) ....
because array is from 0 to n-1 and n can be a problem in your case ...