| control/max-prog-2.c - Endnu en variant med blokke - alternativ 'coding style'. | Lektion 3 - slide 17 : 25 Program 3 |
#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 */
if (x < y)
{
max = y;
}
else
{
max = x;
}
printf("The maximum of x and y is %12.8f\n", max);
return 0;
}