27 lines
507 B
C
27 lines
507 B
C
#include <stdio.h>
|
|
#include "differenz.h"
|
|
#include "summe.h"
|
|
|
|
void berechne(void) {
|
|
printf("Ihre Wahl:\n");
|
|
printf("<S>umme oder <D>ifferenz? ");
|
|
char input;
|
|
scanf("%c", &input);
|
|
int ergebnis;
|
|
if (input == 'S') {
|
|
ergebnis = summe();
|
|
} else if (input == 'D') {
|
|
ergebnis = differenz();
|
|
} else {
|
|
printf("Ungueltige Eingabe\n");
|
|
return;
|
|
}
|
|
printf("Ergebnis: %d\n", ergebnis);
|
|
return;
|
|
}
|
|
|
|
int main(void) {
|
|
berechne();
|
|
return 0;
|
|
}
|