I just started C++.
Well this is what I have so far:
Code:
#include <iostream>
using namespace std;
int main()
{
string x;
cout << "What is the first number you want to add?";
cin >> x;
cout << "The first number you want too add is: " << x << endl;
cout << " " << endl;
string q;
cout << "What is the second number you want to add?";
cin >> q;
cout << "The second number you want to add too " << x << " is " << q << endl;
return 0;
}
My question is; What do I do too add X too Q. I did:
Code:
cout << x + q << endl;
But all that does is make the two numbers side-by-side. So let's say the user chose 7 as the first number and 12 as the second. It would be:
I want it too give me the answer instead of 712. So 7+12 is 19. So it would be: