PJC-0x03/minmax.c
surtur 4ea499623e
Some checks failed
continuous-integration/drone/push Build is failing
added project files and .drone.yml
2020-03-05 13:35:46 +01:00

44 lines
762 B
C

#include <stdio.h>
#include "minmax.h"
#include "main.h"
int maximum()
{
int x, y, z;
printf("Zadejte 3 cisla oddelena mezerou: ");
printf("** printmax **\n");
scanf("%d%d%d", &x, &y, &z);
int max = x;
if ( y > max ) {
max = y;
}
if ( z > max ) {
max = z;
}
// pokud je y vetsi, ulozime jej do max
// pokud je z vetsi, ulozime jej do max
return max;
}
int minimum()
{
int selection, max, min = 0;
while ( selection != 8 ) {
int x, y, z;
printf("Zadejte 3 cisla oddelena mezerou: ");
printf("** printmin **\n");
scanf("%d%d%d", &x, &y, &z);
int min = x;
if ( y < min ) {
min = y;
}
if ( z < min ) {
min = z;
}
}
return min;
}