33 lines
458 B
C
33 lines
458 B
C
/* Minimum, maximum */
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int min(int, int);
|
|
int max(int, int);
|
|
|
|
int main() {
|
|
int a, b;
|
|
|
|
a = 12;
|
|
b = 9;
|
|
|
|
printf("Le min de %d et %d est %d\n", a, b, min(a, b));
|
|
printf("Le max de %d et %d est %d\n", a, b, max(a, b));
|
|
|
|
return 0;
|
|
}
|
|
|
|
int min(int a, int b) {
|
|
if (a <= b) {
|
|
return a;
|
|
}
|
|
return b;
|
|
}
|
|
|
|
int max(int a, int b) {
|
|
if (a >= b) {
|
|
return a;
|
|
}
|
|
return b;
|
|
}
|