// operating with variables
#include <iostream>
usingnamespace std;
int main ()
{
// declaring variables:
int a, b;
int result;
// process:
a = 5;
b = 2;
a = a + 1;
result = a - b;
// print out the result:
cout << result;
// terminate the program:
return 0;
}
exactly. finished execution very quickly and exited but when i add your piece of code
its stayed a=4 b=7 can u explain tom e why its exiting exactly after the program run?
some IDEs support two types of execution, one that closes after finish, and a debug mode that pauses the console before the main returns.
if your IDE support such mode, you can use it, otherwise check this: