![]() ![]() | max-prog.c - Et program som beregner det største af to doubles. | Lektion 2 - slide 15 : 28 Program 1 |
#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; }