Have you tried to debug the code, there are plenty of debuggers present (one present here actually) which can help you correct the code.
Lines # 15-20 have the bug. Please check how if conditions work without the braces & also check what the difference between = & == operator are.
I see you have used the algorithm header , so I would suggest using the find_if algo , it does the same job ,although without having to worry about minor bugs , writing manual loops, etc.
my implementation below:
#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
using namespace std;
int main(){
vector<int>vec{9,6,5,4,-3,-32,-99,-45,-55,-77};
int count{};
bool in_the_vector{false};
#if 0
//Corrected ur code below,to compile it ,just switch #if 0 to #if 1
while (count <= int(vec.size())) {
count ++;
if (vec[count] == -99){
cout<<count<<endl;
in_the_vector = true;
break;
}
}
if(!in_the_vector){
// (vec[count] != -99);
cout<<int (vec.size())<<endl;
count == int(vec.size());
}
#endif
//My implementation below
auto it = std::find_if (begin(vec), end(vec) , [](int i) { return i==-99 ; });
//we got the iterator of the found element
//lets see if the index is valid
auto index = std::distance(begin(vec) , it);
std::cout << index <<std::endl;
return 0;
}