i m starting to learn c++.
i m trying to do a console app.
this is my code but i encountered a problem with it
after i key in num1 and num2
the total will be display for about a few mili seconds and the console terminate itself.
if i add cin.ignore(2) at the end of the code, the console will not terminate itself.
however it i leave the bracket empty, same situation happens again...
i am using dev c++
thanks for helping
#include <iostream>
using namespace std
int main()
{
int num1,num2;
cout << "Please enter num1 : ";
cin >> num1 ;
cout << "Please enter num2 : ";
cin >> num2 ;
cout << "Total of num1 + num2 : " << num1 + num2 << endl;
return 0;
}