summaryrefslogtreecommitdiff
path: root/reference/C/EXAMPLES/macro.c
blob: 05fe12c1e1ac2c602a707f4efe40da4309e7f3d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/****************************************************************
 *
 * Purpose: To demonstrate macros
 * Author:  M.J. Leslie
 * Date:    17-Oct-94
 *
 ****************************************************************/

#define SQUARE(x) x*x

main()
{
  int value=3;

  printf("%d \n", SQUARE(value));
}
/****************************************************************
 *
 * answer will be 9
 *
 ****************************************************************/