/* * main.c * * Created on: Jun 12, 2013 * Author: delmadord */ #include #include #include // ex_01 #define CUBE(x) ((x)*(x)*(x)) #define REMAIND_4(n) ((n) % 4) #define C1(x, y) (((x) * (y)) == 100) // ex_02 #define NELEMS(a) ((int) (sizeof (a) / sizeof (a[0]))) // ex_03 #define DOUBLE(x) (2 * (x)) // ex_04 #define AVG(x,y) (((x) + (y)) / 2) #define AREA(x,y) ((x) * (y)) // ex_05 #define TOUPPER(c) ('a'<=(c)&&(c)<='z'?(c)-'a'+'A':(c)) // ex_06 #define DISP(f,x) printf(#f "(%g) = %g\n", x, f(x)); // ex_07 #define GENERIC_MAX(type) \ type type##_max(type x, type y) { \ return x > y ? x : y; \ } // ex_08 #define STRINGIZE(x) #x #define INDIR(x) STRINGIZE(x) #define LINE_FILE "Line " INDIR(__LINE__) " of file " INDIR(__FILE__) // ex_09 #define CHECK(x,y,n) (((x)>=0&&(x)=0&&(y)