|
C++ cin problem
Hi, I have recently started using C++. I use g++ on Unix. I could not get a simple C++ program working.
The program is;
#include <iostream>
using namespace std;
int main()
{
double a, b;
cout << "enter your number";
cin >> a;
b = a + 1.15;
cout << b << endl;
return 0;
}
when I run this, I get;
$enter your number1.15
It does not get 'a' from the user. It assumes that 'a' is zero.
Where do I go wrong?
|