// while1.cc
// Example program on using a while loop in C++
// Play around with the code so you understand how a while loop works!
// change the start value, iteration, terminiation condition - ect.
// Michael Haggerty for CISC105
#include <iostream>

// A heavy handed way to avoid typing std::cout 
// This is a quick and dirty way to avoid the whole std:: thing, typically
// it is used by C programmers - but it can lead to cleaner, more readable code
// May lead to ambiguity in more complex programs - USE WITH CAUTION.
using namespace std;

int main()
{
   int i = 0; // initialize the while loop
   while (i <= 5)
   {
      cout << "i = " << i << endl;
      // iterate the loop condition
      i++;  // shorthand for i = i + 1;
   }
   
   return 0;
}
