CodeBlocks now runs the different programs I open but it stops halfway through.
For example, I have this program:
#include <iostream>
using namespace std;
int main()
{
int a,b;
cout<<"Insert an integer value for variable a\n" ;
cin>>a;
cout<<"Insert an integer value for variable b\n" ;
cin>>b;
int result;
result = a + b;
cout<<"Sum of a and b:"<<result<<"\n";
result = a - b;
cout<<"Difference of a and b:"<<result<<"\n";
return 0;
}
The program runs until the second cin, then the window suddenly closes. Why is this?