/************************************************************************
*									*
*             Compare Two Numbers in a Function (C Version)             *
*									*
************************************************************************/

/*  Authors:  Saeid Nooshabadi and John Zaitseff
    Date:     8th March, 2003
    Version:  1.2

    This program compares two integer numbers.  The difference between
    this program and cmp-c-s.c is that this one uses a function, larger().

    This file also illustrates the concept of making sure that every
    function is well-documented.  This might be considered "overkill" in a
    program this short, but think of having to read a program tens of
    thousands of lines long, with no comments in it!
*/


/*  ---------------------------------------------------------------------
    Function:    larger         - Return the larger of two integers
    Parameters:  first          - The first integer to be compared
                 second         - The second integer to be compared
    Returns:     int            - The larger of two integers

    This function compares two signed integers and returns the larger.
*/

int larger (int first, int second)
{
    if (first > second) {
	return first;
    } else {
	return second;
    }
}


/*  ---------------------------------------------------------------------
    Function:    main           - Main program entry point
    Parameters:  (none)         - No parameters are passed
    Returns:     int            - The larger of two integers

    This is the main program.  It compares two integers (using a separate
    function) and returns the larger value.
*/

int main (void)
{
    int a = 0xE0001234;
    int b = 0x00004567;
    int c;

    c = larger(a, b);
    return c;
}
