need help with code for drink program

HI everybody ! i am a begginer programmer and need some help with my code. It works ok but when i click N at the end it keeps running instead of stopping. Please help. Thanks in advance

#include<iostream>
using namespace std;

int main()
{

char choice = ' ';
int input;


while (choice != 'N')

{
cout << " choose drink : 1 for coke 2 for pepsi and 3 for orange juice" << endl;
cin >> input;

switch (input)
{
case 1:
cout << " you choose coke" << endl;
break;

case 2:

cout << " you choose pepsie" << endl;
break;

case 3:

cout << " you choose orange juice" << endl;

break;
default:
cout << "Error. choice was not valid, here is your money back.\n";
break;
}


cout << " choose another drink enter Y or N" << endl;
cin >> choice;
}


return 0;
}
closed account (21vXjE8b)
The loop will end only if you input 'N' (upper case N).
Change while (choice != 'N') to while (choice != 'N' && choice != 'n')
oh ok it works now. thanks very much !
Topic archived. No new replies allowed.