/*
    Program to illustrate how to use cin
    
    cout << variable    puts the value of variable on the output stream, i.e. write to the screen.
        
    cin >> variable     reads a value from the input stream (keyboard) and puts it into the variable.
    
    Bad things happen if the values are misformatted. Try e.g. entering 4.5 as the integer.
    
    See Nyhoff kap 11.
*/

#include <iostream>           // Include cin / cout streams for input/output
using namespace std;          // Use this otherwise we need to write std::cout below.

int main()               
{          
   int n;
   double x;
   
   cout << "Please enter an integer: n=";
   cin >> n;

   cout << "Please enter a double: x=";
   cin >> x;
   
   cout << "Thank you." << endl;
   cout << "Received n=" << n << endl;
   cout << "Received x=" << x << endl;

   return 0;
}
