Im trying to create a program that has the user input a 5 digit number. If it's between 10000 & 99999, it will do one thing..(just saying 'yes' for now. Outside those numbers will prompt the user to input again. However, if the user inputs the exact digits 76087, it should display 'term'.

I think my error is the braces. If someone could help me find my error without 'doing it for me'.

This current code is displaying 'term' whenever the user inputs the 5 digits.

Code:
//Author: Kenneth Watkins

#include <iostream>

using namespace std;
int main()
{
int pin;

     cout << "Welcome to Movie Food\nEnter your 5-digit pin code: " ;
     cin >> pin;
     cout << endl;
     
     while (pin != 76087)
     {
           if (pin >= 10000 && pin <= 76086 || pin >= 76088 && pin <= 99999)
           {
           cout << "yes" << endl;
           break;
           }
           else
           { 
           cout << "Welcome to Movie Food\nEnter your 5-digit pin code: " ;
           cin >> pin;
           cout << endl;
               break;
               }
}
           if (pin = 76087)
           cout << "term" << endl;

                   
                   
system ("pause");
       return 0;
}