/*
  Less simple for loops without integers. see Nyhoff P127-130 P302-308
  
  1) Try changing x=1 to x=0 what happens?
  
  2) Try changing 1.01 to 0.9999 what happens?
*/

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

/*
   for (init definition(s) ;  loop condition ; step expression(s))
     {
        statements
     }
*/

int main()
{
   for (double x=1 ; x<10 ; x*=1.5)                             // anything goes for a loop!
      cout << "x=" << x << "   x^2=" << x*x << endl;

   for (double y=10000 ; y>1.01 ; y=sqrt(y))                    // convergence of sqrt(sqrt(sqrt( .. ))) to 1
      cout << "y=" << y << endl;

   return 0;
}
