PJC-0x03/minmax.c
surtur 9917cd31f0
Some checks failed
continuous-integration/drone/push Build is failing
updated .drone.yml + added some files + changes
* added bubblesort func
* targeting latest cdev image now
* a couple more changes (I know it's lame)
2020-04-12 23:43:35 +02:00

40 lines
633 B
C

#include <stdio.h>
#include "minmax.h"
#include "main.h"
int maximum()
{
int x, y, z;
printf("** printmax **\n");
printf("Zadejte 3 cisla oddelena mezerou: ");
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;
int x, y, z;
printf("** printmin **\n");
printf("Zadejte 3 cisla oddelena mezerou: ");
scanf("%d%d%d", &x, &y, &z);
min = x;
if ( y < min ) {
min = y;
}
if ( z < min ) {
min = z;
}
return min;
}