Macro is a preprocessor directive, also known as macro definition takes the following general form:
#define identifier string
The pre-processor directive replaces every occurrence of the identifier in the source code by the string. The preprocessor directive definition is not terminated by a semicolon. For example
#define COUNT 100 will replace all occurrences of COUNT with 100 in the whole program before compilation.
A nested macro that gives minimum of three values is listed below:
#define minthree(a,b,c) (min(min(a,b),c))
void main()
{
int x,y,z,w;
clrscr(); printf("enter three numbers :\n");
scanf("%d%d%d",&x,&y,&w);
z=minthree(x,y,w);
printf("Minimum of three value is %d",z);
getch();
}