/* declare function Largest:                                           */
/* The function takes 3 integers as parameters and returns the largest */

int Largest (int first, int second, int third);

/* now define the function */

int Largest (int first, int second, int third)
{
    int answer;            /* answer will be the largest we find */

    answer = first;        /* assume the first is the largest */

    if (second > answer)   /* if the second number is larger */ 
        answer = second;   /* then update the answer */

    if (third > answer)    /* now look at the third number */ 
        answer = third;    /* update the answer if we found a greater one */

    return answer;        /* return the answer to the caller */

}   /* main */

/* A test main to show this works */

#include <stdio.h>
int main()
{

    int solution;  /* temporary answer from a call */

    /* Call the function with various sets of test data */

    solution = Largest (10,20,30);            /* find the largest number */
    printf ("Largest is  %i\n", solution);   /* print the answer */

    solution = Largest (5, 10, 6);            /* another test case */
    printf ("Largest is  %i\n", solution);   /* print the answer */

    return 0; /* exit */
}