#include "stdafx.h" #include #define NUMBER_OF_ELEMENTS 100 #define __DEBUG__ //#define KMULT(x,y) x*y // unsafe! x=4+1 y=3 (4+1)*3 KMULT(4+1,3) #define KMULT(x,y) ((x)*(y)) #define KADD(x,y) x+y #define MAX(a,b) (((a)<(b))?(b):(a)) int main() { int a, b = 10, c = 20; double x[NUMBER_OF_ELEMENTS]; double x1, x2, x3; a = KMULT(3 + 1, 4); // 16 a = KMULT(3 + 1, 4); // 7 3+1*4 if defined as #define KMUL(x,y) x*y a = KADD(1, 2); a = (b < c) ? 1 : 0; a = (b < c) ? b : c; // a is min{b,c} if (b < c) a = 1; else a = 0; a = MAX(3, 5); a = MAX(MAX(a, b), c); x1 = MAX(x1, x2); return 0; }