Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define AND &&
- #define OR ||
- #define CHECK(A,B,C) if((A > B AND B > C) OR (B == 0 AND C < A )){printf(" A is greater than B, and B is greater than C");} else {printf(" your condition is not Achieved");}
- main()
- {
- int A,B,C;
- printf(" A is : ") ;
- scanf("%d",&A);
- printf(" B is : ") ;
- scanf("%d",&B);
- printf(" C is : ") ;
- scanf("%d",&C);
- CHECK(A,B,C);
- fflush(stdin);
- getchar();
- }
- // this is an example about "MACRO" in C language and MACRO is in the form of : #define MACRONAME VALUE
- // or #define MACRONAME (parameter) ......like this example
- // .........etc
- // and in this example we used it for 3 MACROS and they are : #define AND &&
- // #define OR ||
- // #define CHECK(A,B,C) if((A > B AND B > C) OR (B == 0 AND C < A )){printf(" A is greater than B, and B is greater than C");} else {printf(" your condition is not Achieved");}
- // and as you can see in the first example is : #define AND(MACRO) &&(value) and the second MACRO too
- // and we used it in the Third MACRO and it worked out so well for us :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement