C++, cin>>, Cout<<

I have codeblocks 11.12 working. I use Teach Yourself C++ in 24 hours, and Teach Yourself C++ in One Hour A Day. The programs all stop at cin>>, I can make some of them work without the cin>> lines. What gives?
(ragmop)

#include <iostream>
using namespace std;

int main()
{
cout<< "This program will help you multiply two numbers. \n";

cout << "Enter the first number: 5 \n";
int FirstNumber = 0;
cin >> FirstNumber;

cout << "Enter the second number: 10 \n";
int SecondNumber = 0;
cin >> SecondNumber;


int MultiplicationResult = FirstNumber * SecondNumber;


cout<< FirstNumber << " x " << SecondNumber;
cout<< " = " << MultiplicationResult << "\n";

return 0;
}

Try inputting a number when it stops, and press enter.
What's up with couting 5 and 10 Ps if u doing \n I suggest << std::flush otherwise std::endl;
Last edited on
Ispil (105) Thanks it works just fine. ragmop
Last edited on
Topic archived. No new replies allowed.