initial import
[staff/goc4/2018bti7061.git] / c-6-additional / examples / c-variousexamples / macro.c
1 #include <stdio.h>
2
3 #define area length * width
4
5 int main(int argc, char* argv[]){
6
7 int length, width;
8
9 printf("length : ");
10 scanf(" %d",&length);
11 printf("width : ");
12 scanf(" %d",&width);
13 // The constant area is replaced by value length * width
14 printf("Area = %d \n",area);
15
16 }
17 /* Output:
18 bie1@VirtualBox:~/variousExamples$ ./macro
19 length : 10
20 width : 10
21 Area = 100
22 */