[圖解C] Example 801: compare value1 to value2 by using function

// Example 801: compare value1 to value2
// using function

#include <stdio.h>
#include <stdlib.h>

int find_Max(int, int);

int main()
{
    int v1, v2, max;
 
    printf("enter the integer v1: ");
    scanf("%d", &v1);
    printf("enter the integer v2: ");
    scanf("%d", &v2);
 
    max = find_Max(v1, v2);
    printf("The Max Value: %d\n", max);
 
    system("pause");
    return 0;
}

int find_Max(int v1, int v2)
{
    if (v1 > v2)
       return v1;
    else
       return v2;
}