What is the value of the variables “i” and “counts” at the end of this program block?

int count = 0;
int i = 0;
while(count < 20){
      i++;
      if(count % 5 == 0)  break;
      if(count % 2 == 0) count += 2;
      if (count % 4 == 0) count--;
      if (count % 3 == 0) count *= 2;
}


Difficulty level
This exercise is mostly suitable for students
i is equal to 1 since count %5 ==0 will be executed, thus break will be executed.

Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Finding a value in an array using binary search