if logic

Why is this if command running regardless if plan input is A, B, or C?

#include "stdafx.h"
#include <iostream>


using namespace std;

int main()
{
cout << "Jordan Bailey" << endl;

double hour_usage;
double month_number;
char plan;

cout << "Enter your plan:";
cin >> plan;

if ((plan!=('A'||'B'||'C'))){
cout << "Error. ISP package not valid" << endl;//if plan input is not A, B or C display this message
system("pause");//pause program
return 0;//close program
}


system("pause");
return 0;
#include "stdafx.h"
#include <iostream>


using namespace std;

int main()
{
cout << "Jordan Bailey" << endl;

double hour_usage;
double month_number;
char plan;

cout << "Enter your plan:";
cin >> plan;

if ((plan != ('A'))) {
if ((plan != ('B'))) {
if ((plan != ('C'))) {

cout << "Error. ISP package not valid" << endl;//if plan input is not A, B or C display this message
system("pause");//pause program
return 0;//close program
}}}


system("pause");
return 0;
}
Topic archived. No new replies allowed.