// 02Manipulators.cpp
// Using manipulators from iomanip
// Week 2: CS319 - Scientific Computing

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

#include <iomanip>

int main()
{
  int i, fib[16];
  fib[0]=1; fib[1]=1;

  cout << "\n\nWithout the setw  manipulator" << endl;
  for (i=0; i<=12; i++)
  {
    if( i >= 2)    fib[i] = fib[i-1] + fib[i-2];
    cout << "The " << i << "th " <<
      "Fibonacci Number is " <<  fib[i] << endl;
  }

  cout << "\n\nWith the setw  manipulator" << endl;
  for (i=0; i<=12; i++)
  {
    if( i >= 2)    fib[i] = fib[i-1] + fib[i-2];
    cout << "The " << setw(2) << i << "th " <<
       "Fibonacci Number is "  << setw(3) <<  fib[i] << endl;
  }

  return(0);
}

