/*
    Print program to illustrate how cout stream works

    See Nyhoff P86 for intro and P435 for details
*/

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

int main()               
{          
   int number=42;

   cout << "number=" << number << "" << endl;                // prints number

// Formatting number with 10 char wide field
   cout << "number=|" << setw(10) << number << "|" << endl;
   cout << "number=|" << left << setw(10) << number << "|" << endl;

// And in octal and hexadecimal (base 8 or 16)
   cout << "number=" << oct << number << " in octal" << endl;
   cout << "number=" << hex << number << " in hex" << endl;

   return 0;
}
