I have 1 simple code in c++. That code calculate sum of 2 entered numbers. I convert that code to .exe for running windows. My problem is it will work but it doesn't show sum. After entering second number program closes immediately. I have no idea why this happen.
Here is my code:
#include <iostream>
using namespace std;
int main()
{
int a, b;
cout << "Please enter first number \n";
cin >> a;
cout << "Please enter second number \n";
cin >> b;
int z = a + b;
cout << "Sum of these numbers are: " << z;
}
I find solution via command prompt. But I want to completely run my .exe file without command prompt