//-------------------------------------------------------------------------
//
// io.cpp
//
// Written by:    Elizabeth Sklar, Simon Parsons
//                (based on an example from Ira Pohl)
//
// Last modified: 10th October 2007
//
// Another program to illustrate the use of formatted output
//
//-------------------------------------------------------------------------

// We need iostream for the basic i/o and iomanip for the manipulators.

#include <iostream>
#include <iomanip>
using namespace std;

int main() {
  long double r;
  cout << "Enter length of side: ";
  cin >> r;
  cout << "no formatting:          area=" << r*r << endl;
  cout << "width:                  area=" << setw(20) << r*r << endl;
  cout << "width and precision:    area="
       << setw(20) << setprecision(10) << r*r << endl;
  cout << "width, precision, fill: area=" << setfill('*')
       << setw(20) << setprecision(10) << r*r << endl;
} 
// End of main()
