Hi there,
I am experiencing a problem during the program execution.
Here is the program:
#include <iostream>
using std::cout;
using std::cin;
int additions (int a, int b, int c)
{
int k;
k = a+b-c;
return k;
}
int main()
{
int s;
int x;
int y;
int z;
cout << "The first number is: \n";
cin >> x;
cout << "The second number is: \n";
cin >> y;
cout << "The third number is: \n";
cin >> z;
s = additions (x,y,z);
cout << "The result is: " << s << "\n";
if (s == 4)
cout << " \a\a\a";
return 0;
}
Basically, when I click on the exe file in the debug folder, the program doesn't execute properly: it asks for the first number, second and third and then when I click enter the terminal disappears (I am using windows XP and the compiler is VC++ 6.0 trial copy).
If I instead compile the program and run it from VC++ (with ctrl F5) everything goes well...what am I doing wrong?
Thanks