#include <iostream>
#include <string>
usingnamespace std;
short question(short);
short question(short a){
string answer;
for(;;)
{
//question 1
cout << "question "<< a << endl << endl;
cout << "Do you:" << endl;
cout << "A) answer1" << endl;
cout << "B) answer2" << endl;
cout << "C) answer3" << endl;
cout << "D) answer4" <<endl <<endl;
cin >> answer;
if (answer == "a"|| answer == "A"){//||=Mentally Or
cout << "You go to pick up your pack of cigerettes, but they are no longer there." <<endl <<endl;
a++;
}
elseif (answer == "b"|| answer == "B"){
cout << "You pick up the phone, but there is no dial tone."<<endl <<endl;
a++;
}
elseif (answer == "c"|| answer == "C"){
cout << "You don't see a dead body anywhere."<<endl <<endl;
a++;
}
elseif (answer == "d"||answer == "D"){
cout << "You throw your bloody clothes in the garbage."<<endl <<endl ;
a++;
}
else
cout << "That is not a correct answer, please try again."<<endl <<endl;
if(answer == "a","b","c","d")
{
break;
}
}
//next question
return question(a);
}
int main(){
short a=1;
question(a);
}
I wrote this for u it's doing what u wanna do better i guess
it is using an 'a' as short it will help u to pass next question and i add || it told compiler mentally or(and one more unnecessery information && mentally and)