The issue I am running into is that when I run the code, it adds correctly but when it comes time to run the if or else statement, nothing happens. It always just ends.
#include <iostream>
using namespace std;
int main()
{
int firstNumber;
int secondNumber;
int sum;
char restart = 1;
while (restart == 1)
{
cout<<"Welcome to My Calculator!\n\n";
cout<<"What is the first number you would like to add?\n\n";
cin>>firstNumber;
cout<<"What is the second number you would like to add?\n\n";
cin>>secondNumber;
cout<<"Wonderful! Getting together your result now....\n\n";
sum = firstNumber + secondNumber;
cout<< sum<<endl;
cout<<"If you have another question, just enter 1, if not press 2!\n\n";
cin>>restart;
if (restart == 1)
{
cout<<"No problem!\n\n";
}
else
{
cout<<"Goodbye!";
}
}
return 0;
}