Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created April 11, 2012 13:43
Show Gist options
  • Save roxlu/2359371 to your computer and use it in GitHub Desktop.
Save roxlu/2359371 to your computer and use it in GitHub Desktop.
Number sequences
// source: http://stackoverflow.com/questions/10105229/c-c-puzzle-to-print-values-from-1-15-15-1-with-a-single-for-loop
for (int i = 1; i < 31; i++) {
int number = (1-i/16) * i + (i/16) * (31 - i);
printf("%d ", number);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment