int pos1=0;
int pos2=0;
int i=0;
int j=0;
int k=0;
int temp;
int temp2=0;
int count=0;
int m=0;
i fixed this problem.
the problem was solved when you define these parameters in loop() function .
k parameter values ??can not be more positions value.