Ok, so I was writing a simple interface for a programming I'm creating and i come across this issue, where it gives me the same response regardless.
#include <iostream>
using namespace std;
int main()
{
char v;
cout << "Binary or ASCII? "<<endl;
cin >> v;
if (v == 'B' || 'b')
{
cout << "Binary " << endl;
}
else if (v == 'A' || 'a')
{
cout << "ASCII " << endl;
}
else
{
cout << "ERROR: Invalid Option" << endl;
}
return 0;
}
The interface is supposed to output
Binary
if I type B or b
ASCII
if i type A or a
and
ERROR: Invalid Option
for everything else
Instead, I get
Binary
regardless of what I type
Where is my mistake? what am I doing wrong?