2 changed files with 16 additions and 13 deletions
@ -0,0 +1,13 @@
@@ -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 |
@ -1,18 +1,8 @@
@@ -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; |
||||
} |
||||
|
Loading…
Reference in new issue