I've been trying for the past hour to get this binary search algorithm to work and by using an example of the algorithm as explained on khan academy, I still can't get it to work, it should output a number but nothing happens. The example on khan academy is like this:

> 
> 1. Let min = 0 and max = n-1.
> 2. If max < min, then stop: target is not present in array. Return -1.
> 3. Compute guess as the average of max and min, rounded down (so that it is an integer).
> 4. If array[guess] equals target, then stop. You found it! Return guess.
> 5. If the guess was too low, that is, array[guess] < target, then set min = guess + 1.
> 6. Otherwise, the guess was too high. Set max = guess - 1.
> 7. Go back to step 2.
> 
> 
> 

And the code I wrote according to the steps is:

```
#include <iostream>
int main() {
int arr[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };
int min = 0;
int max = 24;
int guess;
int targetValue = 73;
while (max > min) {
    guess = ((max + min) / 2);
    if (arr[guess] == targetValue) {
        std::cout << guess;
        break;
    }
    else if (arr[guess] < targetValue) {
        min = guess + 1;
    }
    else {
        max = guess - 1;
    }
}
return 0;
}

```