You have some basic errors
here is the correct code:
Code:
// Addition Program revised
#include <iostream>
using namespace std;
int main()
{
int num1, num2, sum;
cout << "Enter first number to be added:";
cin >> num1;
cout << "Enter second number to be added:";
cin >> num2;
sum = num1+num2;
cout << "Your sum is " << sum << endl;
/* remove this line */ cin >> sum;
cin.get();
return 0;
}
What happened earlier is that the line that does the math was after printing the output. You need to put that line before printing the output. You also used cin after the output. I have no idea why u did that.