im trying to make a simple test program that asks simple questions and such. heres the code i made but it doesnt work.
i just want to get it to say different sentences based on whether you said yes or no to the question.Code:#include <iostream> using namespace std; int main() { char name [20]; char quest [5]; cout<<"Hi whats your name?\n"; cin>>name; cin.ignore(); cout<<"hello "<<name<<" are you tall? (yes or no)\n"; cin>>quest; cin.ignore(); if ( quest=yes ){ cout<<"thats nice and your tall or so you say anyways\n"; } else if ( quest=no ){ cout<<" hah your short and im a short program\n"; } else { cout<<" YES OR NO!!!!!?? \n"; cin>>quest; cin.ignore(); } cout<<"press enter to quit"; cin.get(); }



LinkBack URL
About LinkBacks


