Im trying to find the number 197 in the array but even when its there, it says that it is not. I can't find what is wrong with my code. What do you guys think?
1) You're calling srand(). This will cause the RNG to return a different sequence of random numbers each time the program is run. You have no guarantee that 197 will be returned by the RNG.
2) You're sorting the array into descending order, however, your binary search is expecting the array in ascending order. Let's assume the middle number is 501. Your binary search is going to assume that 197 is in the bottom half the array, while in reality (if it exists in the array at all), it would be in the upper half.