einbinden weiterer Dateien

This commit is contained in:
Stephan Richter
2018-02-09 15:04:39 +01:00
parent 603534c318
commit e66a1535bf
2 changed files with 16 additions and 13 deletions

13
src/funktionen.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef FUNKTIONEN_H
#define FUNKTIONEN_H
int mult(int a, int b) {
return a * b;
}
int add(int a, int b) {
return a + b;
}
#endif

View File

@@ -1,18 +1,8 @@
#include<stdio.h>
#define DEBUG 5
#include "funktionen.h"
int main() {
int a=2, b=3, ergebnis;
ergebnis = (2*a) + (2*b);
#if DEBUG >= 1
printf("* Debug: ergebnis = (2*%d) + (2*%d);\n", a, b);
#endif
#if DEBUG >= 2
printf("* Debug: a=%d, b=%d, ergebnis=%d\n", a, b, ergebnis);
#endif
printf("Das Ergebnis ist %d\n", ergebnis);
printf("Produkt: %d\n", mult(4, 5));
printf("Summe: %d\n", add(4, 5));
return 0;
}