Name: Anonymous 2011-07-09 13:12
Alright so I'm on learning C++ again.
The lines below work, but I wanted to check, with some simple tweaks I could get this running as a if program and have multiple choices like yes does "x" and no does "no" correct and any other answers would be different correct?
#include<iostream>
#include<string>
using namespace std;
int main ()
{
string a;
string b;
string c;
cout << "hello what's you're name?\n";
cin >> a;
cout << "hello, " << a << " how are you?\n";
cin >> b;
cout << "so " << a << " is doing " << b << ".\n";
cin >> c;
cout << "alirght well have a good day.";
return 0;
}
The lines below work, but I wanted to check, with some simple tweaks I could get this running as a if program and have multiple choices like yes does "x" and no does "no" correct and any other answers would be different correct?
#include<iostream>
#include<string>
using namespace std;
int main ()
{
string a;
string b;
string c;
cout << "hello what's you're name?\n";
cin >> a;
cout << "hello, " << a << " how are you?\n";
cin >> b;
cout << "so " << a << " is doing " << b << ".\n";
cin >> c;
cout << "alirght well have a good day.";
return 0;
}