cin.get() Problems
I got a problem with my program.
When i added "cin.get();" to the last statement, it always add a "10" at the end of my program when i use it.
Thank you in advance.
When i added "cin.get();" to the last statement, it always add a "10" at the end of my program when i use it.
Code:
#include <iostream>
using namespace std;
int main()
{
double result, n, d;
cout << "Enter value: ";
cin >> n;
cout << "Enter divisor: ";
cin >> d;
if(d != 0)
{
cout << "d does not equal zero so division is OK" << "\n";
result = n/d;
cout << n << " / " << d << " is " << result << cin.get();
}
cin.get();
return 0;
}