While loop

Need help trying to figure out why my program wont terminate when I enter -1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  #include <iostream>
using namespace std;

int main()
{
    int Coffee=0,
        Tea=0,
        Coke=0,
        Orange_Juice=0,
        choice,
        p=2;
   
    cout << "1.Coffee  2.Tea  3.Coke  4.Orange Juice" <<endl;
    cout << " "<<endl;
    cout << "Please input the favorite bevarage of person #1: Choose 1,2,3, or 4 from the above menu or -1 to exit the program"<<endl;
    cin >> choice;     
    
    while (choice != (-1))
    {
      
      cout << "Please input the favorite bevarage of person #"<<p<<": Choose 1,2,3, or 4 from the above menu or -1 to exit the program"<<endl;  
      cin >> choice;
      p++;
      
        if (choice=1)
        {
            Coffee++;
        }
    }
 
    
}
if (choice=1)
the = there is the assignment operator. it should be ==
wow i completely missed that thanks for the help
Topic archived. No new replies allowed.