| control/max-prog-3.c - Et attraktivt alternativ - som ikke handler om coding style. | Lektion 3 - slide 17 : 25 Program 4 |
#include <stdio.h>
int main(void) {
double x, y, max;
printf("Enter two real numbers: ");
scanf("%lf %lf", &x, &y);
/* Find the maximum of x and y */
max = (x < y) ? y : x;
printf("The maximum of x and y is %12.8f\n", max);
return 0;
}