Hi guys, As you may figure, this is my first post on the forums, and it has only been one day since I have started learning C++. While exploring the language, I made this
VERY basic program.
This is the code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <iostream>
using namespace std;
int main()
{
string m;
int first;
int second;
int answer;
int third;
cout << "This is the automatic multiplier. Please follow the instructions." << endl;
cout << "Type in \"Yes\" to Continue." << endl;
cin >> m;
cout << "Enter your First number to multiply." << endl;
cin >> first;
cout << "Enter the Second number." << endl;
cin >> second;
cout << "Enter the Third number." << endl;
cin >> third;
answer = first*second*third;
cout << "Your answer is " << answer;
return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When I run the program inside of Code::Blocks, it runs flawlessly, but when I go to the program's directory and open the .exe from the Debug folder, I can insert all the numbers, but when the answer is supposed to come, the program closes right away.
Can someone please tell me if I'm doing something wrong, or if there is a seperate way to save the code as an .exe?
Thanks in Advance!