Skip to content

Instantly share code, notes, and snippets.

@alnorris
Created August 26, 2013 14:26
Show Gist options
  • Save alnorris/6341976 to your computer and use it in GitHub Desktop.
Save alnorris/6341976 to your computer and use it in GitHub Desktop.
List power of 2 with bitwise shift operater
int main(void) {
int i;
for(i = 1; i < 1024; printf("%d\n", i <<= 1)) {}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment