#include /* C Description: Macros usage example * * __DATE__ - current date ( MMM DD YYYY ) * __TIME__ - current time ( HH:MM:CC ) * __FILE__ - current filename as a string * __LINE__ - current line number as a decimal * __STDC__ - equals to 1 is compiler compiles with the ANSI standard */ #ifndef DEBUG #define DEBUG 1 #endif #define average(x,y) \ (x+y)/2. #define MAX(x,y) (x > y ? x : y) int main() { if (DEBUG) { printf("File :%s\n", __FILE__ ); printf("Date :%s\n", __DATE__ ); printf("Time :%s\n", __TIME__ ); printf("Line :%d\n", __LINE__ ); printf("ANSI :%d\n", __STDC__ ); } printf(" Average 1: %6.2f\n", average(7.5, 9.3)); printf(" Average 2: %6.2f\n", average(7, 8)); printf(" Maximum value: %6.2f\n", MAX(7.5, 9.3)); }