Macro without argument example
#include<stdio.h>
#define OR ||
#define AND &&
int main()
{
int p=10,q=20,r=30;
if((p==10) AND (q<25 OR r>=50))
printf("You are winner!!");
else
printf("You are loser!!");
getch();
return 0;
}
The output of above program would be:
![]() |
| Figure: Screen shot of shows macro uses in C program |
A #define directive could be used even to replace a condition as:
