Hey, I'm trying to write a very simple program to add up numbers, but after I enter the second number the program finishes. Here is the code:
it seems to ignore the cin.get function. Can anyone help please? I'm using Dev-C++ 5 beta. Thanks in advance.Code:#include <iostream> using namespace std; int main() { int num1, num2, total; cout <<"Enter the first number: "; cin >> num1; cout <<"Enter the second number :"; cin >> num2; total = num1 + num2; cout <<"The total is :" << total << endl; cin.get(); return 0; }
-Pinny.



Reply With Quote


Bookmarks