Before the sum is given, the program closes. What's causing this?
#include <iostream>
//function main
int main()
{
//var declarations
int number1;
int number2;
int sum;
std::cout << "Enter first number: ";
std::cin >> number1; //read first integer from user into number1
std::cout << "Enter second number: ";
std::cin >> number2; //read second integer from user into number2
sum = number1 + number2; //add numbers stored in int's, store total in sum
std::cout << "Sum is " << sum << std::endl;
return 0;
}