Name: Anonymous 2007-12-20 11:59
hay guyz.
Anyways, I new to programming, I need to know how to use the || operator properly.
ie.
if number is not 3 or 4. ask for another input.
could someone give me an example?
not sure at what point in a loop it goes at.
assuming it could be in a do ( cout << "plz enter valid number: " cin >> number ) while (number != 3 || 4) or something?
but that doesn't work.
It keeps telling me that my number is invalid.
Cheers,
anon.
Anyways, I new to programming, I need to know how to use the || operator properly.
ie.
if number is not 3 or 4. ask for another input.
could someone give me an example?
not sure at what point in a loop it goes at.
assuming it could be in a do ( cout << "plz enter valid number: " cin >> number ) while (number != 3 || 4) or something?
but that doesn't work.
It keeps telling me that my number is invalid.
Cheers,
anon.