Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-std=c99
- #include <stdio.h>
- #include <stdlib.h>
- #include <iso646.h>
- /*
- https://en.wikipedia.org/wiki/C_alternative_tokens
- macro defined as
- -------------------
- and &&
- and_eq &=
- bitand &
- bitor |
- compl ~
- not !
- not_eq !=
- or ||
- or_eq |=
- xor ^
- xor_eq ^=
- */
- int main (int argc, char **argv)
- {
- int a = 0;
- int b = 1;
- if(a==0 and b==2) printf("1: true\n");
- else printf("1: false\n");
- if(a==0 or b==2) printf("2: true\n");
- else printf("2: false\n");
- if(not a) printf("3: true\n");
- else printf("3: false\n");
- return 0;
- }
- /*
- output:
- 1: false
- 2: true
- 3: true
- */
Advertisement
Add Comment
Please, Sign In to add comment