Skip to content

Instantly share code, notes, and snippets.

@b-adams
Created August 27, 2012 13:50
Show Gist options
  • Save b-adams/3488560 to your computer and use it in GitHub Desktop.
Save b-adams/3488560 to your computer and use it in GitHub Desktop.
Counting and pow-2-ing in Decimal and Hex
#include <stdio.h>
int main(int argc, char const *argv[])
{
for(int i=0; i<33; i++)
{
printf("Dec: %4d\tHex: %x\n",i,i);
}
for(int i=0; i<80; i++) { printf("-"); }
printf("\n");
for(int i=1; i<5000; i*=2)
{
printf("Dec: %4d\tHex: %x\n",i,i);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment