This is my code below:
using namespace std;
int main(int argc, char *argv[])
{
int thisisanumber;
int SecondNumber;
int TotalNumber;
TotalNumber = thisisanumber + SecondNumber;
cout<<"Please enter a number: ";
cin>> thisisanumber;
cin.ignore();
cout<<"You entered: "<< thisisanumber <<"\n";
cin.get();
cout<<"Please enter a second number: ";
cin>> SecondNumber;
cin.ignore();
cout<<"Your second number is: "<< SecondNumber <<"\n";
cin.get();
cout<<"Your Total is: "<< TotalNumber <<"\n";
cin.get();
cout<<"Thank you for your patience with my new small but mighty program!";
cin.ignore();
}
I'm starting out...obviously, a newbie here. However, I cannot understand that when I run this code with the first number being 34 and my second number being 40 ....I get the output of 39.
This is not my homework. I'm just trying to learn on my own for now.
Thanks for all you help.
Sincerely,
St!tch.