Created
October 29, 2016 09:45
-
-
Save rainbow23/8b8a068358d78615bf46c5bd4985016a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
for(int i =0; i < 4; i++){ | |
printf("num:%d >> %d\n",i, (i>>1)&1); | |
/* log | |
00 | |
01 | |
10 | |
11 | |
num:0 >> 0 | |
num:1 >> 0 | |
num:2 >> 1 | |
num:3 >> 1 | |
*/ | |
} | |
for(int i =0; i < 4; i++){ | |
printf("num:%d %d\n",i, i&1); | |
/* log | |
00 | |
01 | |
10 | |
11 | |
num:0 0 | |
num:1 1 | |
num:2 0 | |
num:3 1 | |
*/ | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment