1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include <stdio.h> #define SQUARE(x) ((x) * (x)) int main(void) { int x = 2; printf("SQUARE(3) = %d\n", SQUARE(3)); // »ó¼ö¿¡µµ Àû¿ë °¡´É printf("SQUARE(1.2) = %f\n", SQUARE(1.2)); // ½Ç¼ö¿¡µµ Àû¿ë °¡´É printf("SQUARE(2+3) = %d\n", SQUARE(2 + 3)); // ¼ö½Ä¿¡µµ Àû¿ë °¡´É printf("x = %d\n", x); // º¯¼ö¿¡µµ Àû¿ë °¡´É printf("SQUARE(x) = %d\n", SQUARE(x)); // º¯¼ö¿¡µµ Àû¿ë °¡´É printf("SQUARE(++x) = %d\n", SQUARE(++x)); // ³í¸® ¿À·ù return 0; } | cs |