// findMax.cc  10/12/05 P. Conrad

#include <iostream>
using namespace std;

int main(void)
{

  int a[5];
  int b[5] = {3, 17, 16, 5, -1};

  int max = b[0];

  // I know at this point that max is the maximum value
  // of the elements in the array from 0 to 0

  for (int i=1; i<5; i++)   // or use   for (int i=1; i<=4; i++)
    {
      max = ( b[i] >= max ? b[i] : max );


      // I know at this point that max is the maximum value
      // of the elements in the array from 0 up through and including i
    }

  cout << "The largest value is: "  << max << endl;
  
  return 0;
    
   
}

