| intro/sum-input.c - Indlæsning og summering af tal. | Lektion 2 - slide 22 : 24 Program 1 |
/* Sums are computed. */
#include <stdio.h>
int main(void)
{
float sum = 0.0, x;
printf("Input three numbers: ");
scanf("%f", &x);
sum += x;
scanf("%f", &x);
sum += x;
scanf("%f", &x);
sum += x;
printf("Sum: %6f\n", sum);
return 0;
}