2020-03-05 13:35:46 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "minmax.h"
|
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
int maximum()
|
|
|
|
{
|
|
|
|
int x, y, z;
|
|
|
|
printf("** printmax **\n");
|
2020-04-12 23:43:35 +02:00
|
|
|
printf("Zadejte 3 cisla oddelena mezerou: ");
|
2020-03-05 13:35:46 +01:00
|
|
|
|
|
|
|
scanf("%d%d%d", &x, &y, &z);
|
|
|
|
int max = x;
|
|
|
|
if ( y > max ) {
|
|
|
|
max = y;
|
|
|
|
}
|
|
|
|
if ( z > max ) {
|
|
|
|
max = z;
|
|
|
|
}
|
|
|
|
return max;
|
|
|
|
}
|
|
|
|
|
|
|
|
int minimum()
|
|
|
|
{
|
|
|
|
int selection, max, min = 0;
|
|
|
|
|
2020-04-12 23:43:35 +02:00
|
|
|
|
2020-03-05 13:35:46 +01:00
|
|
|
int x, y, z;
|
|
|
|
printf("** printmin **\n");
|
2020-04-12 23:43:35 +02:00
|
|
|
printf("Zadejte 3 cisla oddelena mezerou: ");
|
2020-03-05 13:35:46 +01:00
|
|
|
|
|
|
|
scanf("%d%d%d", &x, &y, &z);
|
2020-04-12 23:43:35 +02:00
|
|
|
min = x;
|
2020-03-05 13:35:46 +01:00
|
|
|
if ( y < min ) {
|
|
|
|
min = y;
|
|
|
|
}
|
|
|
|
if ( z < min ) {
|
|
|
|
min = z;
|
|
|
|
}
|
|
|
|
return min;
|
|
|
|
}
|