Hey, I'm trying to write some basic Do while loops. Have done a couple this morning and all worked fine, but for some reason I cant get this one working properly.. I just cant figure out why I'm sure its set up exactly as my previous ones. Please someone help me I don't really like do while loops but I'm trying to understand them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <string>
usingnamespace std;
int main(){
string choice;
do{
cout<<"Please select one of the following: "<<endl;
cout<<"1. Steak"<<endl;
cout<<"2. Pork"<<endl;
cout<<"3. Fish"<<endl<<endl;
cin>>choice;
cout<<endl;
} while ((choice!="Steak") || (choice!="Pork") || (choice!="Fish"));
cout<<"Great choice!";
}
Ahh Thanks coder777. I thought it was just going to be something stupid like that I just couldn't figure it out.. Looks like I'm going to have to practice the difference between my &&s and ||s.