Write a code to compare the maximum value of any two numbers

Write a code to compare the maximum value of any two numbers

#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int Max(int x, int y)
{
if (x>y)
return x;
else
return y;
}
int main()
{
int num1 = 10;
int num2 = 20;
int max = 0;
max = Max(num1, num2);
printf(“max=%d\n”, max);
system(“pause”);
return 0;
}

This simple comparison of sizes is complete

Guess you like

Origin blog.csdn.net/weixin_54748281/article/details/113484399