Hey guys,
This is only my second thread on DaniWeb and I am a beginner programmer.
My code looks like this: (really easy to understand and shouldn't need any further explanation besides the fact that I need help understanding why when i give an answer related to the 'else' loop, it says what is needed, but gets stuck in an infinite loop!)
#include <iostream>
#include <string>
using namespace std;
int main() {
char answer;
cout << "do you think megan fox is hot? <y/n> "<<endl;
cin>>answer;
do {
if (answer == 'y' || answer == 'Y')
cout<<"You are the man"<<endl;
else if (answer == 'n' || answer == 'N')
cout<<"What is wrong with you?"<<endl;
else
cout<<"answer the question with a 'y' or 'n' please."<<endl;
} while (answer == 'y' || answer == 'Y' || answer == 'n' || answer == 'N');
cin.get();
return 0;
}