bedingte compilierung, 2

This commit is contained in:
Stephan Richter
2018-02-09 15:00:44 +01:00
parent a4035ae62e
commit 603534c318

View File

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