Do you TRY it? It works.
#include <stdio.h>
int main (void)
{
int a, b, c, d, min1, max1, min2, max2, min, max;
scanf ("%d %d %d %d", &a, &b, &c, &d);
if (a > b)
{
max1 = a;
min1 = b;
}
else
{
max1 = b;
min1 = a;
}
if (c > d)
{
max2 = c;
min2 = d;
}
else
{
max2 = d;
min2 = c;
}
if (min1 < min2) min = min1;
else min = min2;
if (max1 > max2) max = max1;
else max = max2;
printf ("%d %d", max, min);
return 0;
}
Sample running, with A as 1 and B as 10 (i.e. highest AND lowest in A and B):
$ ./a.exe
1 10 4 5
10 1
Sample running, with A as 1 and D as 4:
$ ./a.exe
1 2 3 4
4 1
It works.