snp-lab-code/P01_Erste_Schritte_mit_C/P1_aufgabe3.c

22 lines
409 B
C
Raw Permalink Normal View History

2022-03-15 08:55:38 +01:00
#include <stdio.h>
#include <stdlib.h>
#define NUM_ROWS 5
int main(void) {
int value = 0;
int row = 0;
double umrechnungsfaktor = 0.0;
(void)printf("Enter conversion rate (1.00 BTC -> CHF): ");
scanf("%lf", &umrechnungsfaktor);
for(row = 1; row <= NUM_ROWS; row += 1) {
value += 200;
(void)printf("%d CHF <--> %f BTC \n", value, value / umrechnungsfaktor);
}
return EXIT_SUCCESS;
}