# If question ?

• 01-26-2009
Nathan the noob
If question ?
Code:

```if(input == "mom" || "Mom" || "MOM" || "MOm" || "moM" || "MoM" || "mOM" || "mOm")     {             if(mom == 0 && dad == 0)             {             cout << "Im not yer mom ..........\n";             mom = 1;             }               if(dad == 0 && mom == 1)             {             cout << "I told you already im not yer Mother\n";             }             if(dad == 1 && mom == 0)             {             cout << "Im not yer Mom Either\n";             mom = 1;             }             if(dad == 1 && mom == 1)             {             cout <<"Im not yer parent at all u Hoe\n";             }     }```
Why dont that work no matter wat i type it shows this and all the other if commands that have || in them how do i fix this
• 01-26-2009
brewbuck
The pattern

Code:

`if(a == x || y || z)`
Doesn't do what you want. You need:

Code:

`if(a == x || a == y || a == z)`
• 01-26-2009
Nathan the noob
Hey thanks alot brewbuck :P Cant totally learn from the books
• 01-26-2009
auralius
Code:

```int len = strlen(input); for ( int ix = 0; ix < len; ix++) {     input[ix] = tolower( (unsigned char) input[ix] ); } if(input == "mom")     {             if(mom == 0 && dad == 0)             {             cout << "Im not yer mom ..........\n";             mom = 1;             }               if(dad == 0 && mom == 1)             {             cout << "I told you already im not yer Mother\n";             }             if(dad == 1 && mom == 0)             {             cout << "Im not yer Mom Either\n";             mom = 1;             }             if(dad == 1 && mom == 1)             {             cout <<"Im not yer parent at all u Hoe\n";             }     }```
i think that would be much better...since you convert first to lower case...
• 01-26-2009
Nathan the noob
Umm watever taht is it gives me a error saying wat is the include for that?
• 01-26-2009
laserlight
auralius' basic idea is to change all the letters of the string into lower case so you can compare more easily. You can ignore the actual implementation except for the use of tolower() which is found in <cctype>.