-4
cout << "Enter 'X' for uberX or 'S' for SUV or 'L' for luxury: "<< endl;
cin >> typeCar;
typeCar = toupper(typeCar);  
if (typeCar != 'X' || 'S' ||'L') 
{
    cout << "Enter X, S, or L"<<endl;
    system("pause"); 
}

Regardless of if I input 'X' 'S' or 'L', it always executes this statement. Same goes for when I put in lowercase.

StoryTeller - Unslander Monica
  • 165,132
  • 21
  • 377
  • 458

1 Answers1

-2

You need to evaluate each statement separately.

if(typechar! = 'x' || typechar! = 'Z')
OA617
  • 76
  • 6