First, the array is declared incorrectly and you also have an infinite loop there. The loop is
while(a==true)
and nothing sets
a
to false or breaks out of the loop so it will continue for ever, run out of data in the array, and eventually crash. You could do something like this :
const int arraySize = 11;
int array[ arraySize ] = {2,4,5,7,9,12,23,34,45,56,77};
and then loop while a counter is less than
arraySize
but it's difficult to guess exactly what you are trying to do with this.