Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

i needz help (C++)

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.

Name: Anonymous 2007-12-20 12:23

>>3 That makes some sense, but what happens when it's numbers like 4 and 6, without 5?
ie. input must be either 4 or 6. if you enter any other number, it should show an invalid message.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List