//  neatColumns1.cpp
//
//  Displays table of powers of two,
//  with right-justified columns.
//  Demonstrates the setw manipulator with integers.

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
   cout << "Powers of two" << endl;
   cout << "-------------" << endl << endl;
   cout << "Exponent     Power" << endl;
   cout << "--------     -----" << endl << endl;

   int power = 1;
   int exponent = 0;

   while ( power < 100000 )
   {
      cout << setw(5) << exponent << " "
                  << setw(11) << power << endl;
      power *= 2;
      exponent++;
   }  // while

   return 0;
}  // function main