#include <iostream>
#include <string>
#include <windows.h>
using std:: cout;
using std:: cin;
using namespace std;
int main()
{
unsigned long n;
char Answer;
string mystr;
do {
cout << " What is your name? ";
getline (cin, mystr);
cout << "Hello " << mystr << ".\n";
cout << "What is one of your hobbies? ";
getline (cin, mystr);
cout << "Cool, I also like " << mystr << "!\n";
cout << "Can you guess my name? ";
getline (cin, mystr);
cout << "Haha, good guess " << mystr << " that is funny, trick question I do not have a name! \n";
cout << "Do you like parkour?(y/n)? ";
cin >> Answer;
if(Answer == 'y' || Answer == 'Y')
cout << "\nYou have been promoted to cool.\n";
if(Answer == 'n' || Answer == 'N')
cout << "\nDo you know what it is?(y/n)? ";
cin >> Answer;
if(Answer == 'y' || Answer == 'Y')
cout << "\nGood.";
if(Answer == 'n' || Answer == 'N')
cout << "\nGo and Google it, then talk to me again.";
cout << " I am tired, I will go to sleep now. ";
cout << "Do you want to do it again? (y/n)";
} while ( Answer = n);
return 0;
}
I am writing a program, this is my first program not copied out of a book. I am trying to loop from the while back up to the do. I do not know if this is the correct form of a loop to use because I am a noob. All help and pointers will help :) *edit* When i run it and get to the end it meshes together and asks 2 questions at the same time