//============================================================== // Ilustracja dyrektywy preprocesora #define;
// makro; //
// ver data temat autor // 100 2005/10/12 Pierwszy projekt J. Malinowski // 101 2007/11/08 Cleanup JM // 102 2019/12/12 Cleanup JM //============================================================== #include <iostream> #include <conio.h> using namespace std; //============================================================== #define SQUARE(x) ((x)*(x))
#define MAX(x,y) ((x)>(y) ? (x) : (y))
//============================================================== int main() { int iz,ix=2; iz=SQUARE(2); cout << iz;
cout << "\nwartosc dla SQUARE(2): " << SQUARE(2) << "\n\n"; cout << "\nwartosc dla SQUARE(x): " << SQUARE(ix);
cout << "\n\n Makrodef. Max: " << MAX(ix,iz) << endl; getch();
return 0; }