I've written the following code but cannot understand why the loop ignores the condition. When the program runs and numbers above 5 and below 0 are entered(which makes the while condition true as far as I can understand) the program executes the cout statement outside the while statement instead of the while statement. I hope this makes some sort of sense. Not sure if my variable is initialised correctly.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int beverage;
//Displaying the different choices of beverages
cout << "Please enter the choice of drink";
cout << " (a number from 1 to 4 or 0 to quit)" << endl;
cout << "Hot beverage Menu" << endl << endl;
cout << "1: Coffee " << endl;
cout << "2: Tea " << endl;
cout << "3: Hot Chocolate " << endl;
cout << "4: Cappuccino " << endl;
cout << "0: QUIT " << endl << endl;