I want my program to check whether every element in the entire int[] array is non-zero.
What I currently have:
for(int i=0; i<myArray.length; i++)
{
if(myArray[i] == 0)
{
completed = false;
}
else
{
completed = true;
}
}
But the loop keeps doing else statement, if only one array in the middle is non-zero and won't check the rest of the array.