My program:
#include <iostream>
using namespace std;
int main()
{
//I'm declaring some variables.
int number1, number2, product, sum;
cout << "Please enter an integar (whole number): \n";
cin >> number1;
cout << "Please enter a another integar: \n";
cin >> number2;
//Computing the numbers.
product = number1 * number2;
sum = number1 + number2;
//This will reveal the final computations.
cout << "The sum of " << number1 << " and " << number2 << " equals: " << sum << "\n";
cout << "The product of " << number1 << " and " << number2 << " equals: " << product << "\n";
cin >> sum >> product;
cin.ignore();
return 0;
}
The problem with this code is that after the program finishes everything that it needs to, it won't terminate. Instead, it forces me to input two extras times. I suspect that it's probably because of the code
. The problem is, when/if I remove that code, the program won't execute. I've tried everything I knew but can't a way around it. Maybe something else is wrong with the program?
Thanks in advance.