0.) It tries to check whether min (value: 0) is less than or equal to max (value:9). It checks if pp (value: -1) is really equal to -1. The purpose for this is to check whether the condition is met and the program must execute it. While loop is a loop so terminating conditions were given.
1.)Remember that a variable of type integer cannot possess a value which is a floating point. (mid = 0 + 9) / 2, that is mid = 9 / 2, therefore mid = 4 and NOT 4.5. Purpose for this statement is to find the MIDDLE NUMBER and NOT THE MIDDLE ELEMENT VALUE.
2.)Use the MIDDLE NUMBER (mid) as address to find the middle element in array num. Then compare it with the item that you want to find. e.g. num[4] == m.
3.)If number 2 is True, then assign mid to pp.
5.)If number 2 is False, then Compare middle element if it is less than the item that you want to find.
6.)If number 5 is True, then Add 1 to middle number and assign it to min. min = 4 + 1, therefore min is now 5. Remember that item that you want to find is BIGGER than the middle element in the array num, therefore min value must increase its value. To make it clearer, find that value within the range of 5(min) to 9(max).
8.)If number 5 is False, Then Subtract 1 to middle number and assign it to max. max = 4 - 1, therefore max is now 3. Remember that item that you want to find is SMALLER than the middle element in the array num, therefore max value must decrease its value. To make it clearer, find that value within the range of 0(min) to 3(max).
Hope this helps!