Hey, im new to c++, so no doubt making stupied mistakes, im working on a program which could get me into a job learning c++ and making software from scratch, but i have to create a program beforehand, i am doing a program which give the user a choice wether to add and takeaway with an if statement, but when you enter a number to choose from, it just adds another line then closes, please help :)p.s its not a finished program, i havent started on choice two i have just put "two" so i know if it works or not.
#include<iostream>
using namespace std;
int firstnumber;
int secondnumber;
int main()
{
char answer[10];
cout<<"Please Choose an option"<<endl;
cout<<" * Addition - one"<<endl;
cout<<" * Subrtraction - two"<<endl;
cin>>answer;
cin.ignore();
if (answer == "one") {
cout<<"You have choosen addition, please enter your first number...";
cin>>firstnumber;
cout<<"please enter your second number...";
cin>>secondnumber;
cout<<"you answer is.."<<firstnumber + secondnumber <<endl;
}
else if (answer == "two") {
cout<<"Choice two";
}
cin.get();
}