// demoSmaller.cc P. Conrad  2/25/2005
// for CISC181, Spring 2005
// demonstrate functions to find smaller of two ints
// and demonstrate function to find smallest of three ints

#include <iostream>
using namespace std;

int smaller(int a, int b); // return the smaller of a and b

int smallest(int a, int b, int c); // return the smallest of a, b, c

int foobar(int x, float y); // this function is a figment of my imagination

// @@@ can you spot the error(s)???

int main (void)
{ 
  int x, y, z;

  // prompt user for input 

  cout << "Enter three integer values (for x, y, z):";
  cin >> x >> y >> z;

  // echo back input to user
  cout << "x=" << x << " y=" << y << " z=" << z << endl;

  // print results

  cout << "The smaller of x and y is: " << smaller(x,y) << endl;
  cout << "The smaller of y and z is: " << smaller(y,z) << endl;
  cout << "The smallest of x, y, z is: " << smallest(x, y, z) << endl;

  return 0;
} 


int smaller(int a, int b)
{
  if (a<b)
    return a;
  else
    return b;
}

int smallest(int a, int b, int c)
{
  // @@@ THIS FUNCTION NOT FINISHED YET
  // @@@ FINISH IN LECTURE
  
  return 0; // temporary return statement as placeholder
}

// this function makes no sense, but is legally syntactically.
// introducing a function that is "never called" doesn't introduce
// a syntax error.
int smallust(int a, int b, int c)
{
  return -99;
}






