Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Simple implementation of & bitwise operator
- */
- #include <stdio.h>
- #define TUNA_A 1
- #define TUNA_B 2
- #define TUNA_C 4
- #define TUNA_D 8
- void main(){
- int test1 = 3;
- int test2 = 7;
- int test3 = 8;
- int test4 = 12;
- if(test3 & TUNA_A){
- printf("TUNA_A\n");
- }
- if(test1 & TUNA_B){
- printf("TUNA_B\n");
- }
- if(test1 & TUNA_C){
- printf("TUNA_C\n");
- }
- if(test3 & TUNA_D){
- printf("test1 TUNA_D\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement