Skip to content

Instantly share code, notes, and snippets.

@Taluu
Last active December 20, 2015 09:59
Show Gist options
  • Save Taluu/6111938 to your computer and use it in GitHub Desktop.
Save Taluu/6111938 to your computer and use it in GitHub Desktop.
dafuq ?!
#include <stdio.h>
#include <stdlib.h>
int main() {
int i = 42,
j = 42,
k = 42,
sum = 0;
printf("%d\n\n", i++ + ++i + ++i + i++ + i++); // 218
printf("%d\n", j++); // 42
printf("%d\n", ++j); // 44
printf("%d\n", ++j); // 45
printf("%d\n", j++); // 45
printf("%d\n\n", j++); // 46
printf("%d\n", sum += k++); // 42
printf("%d\n", sum += ++k); // 86
printf("%d\n", sum += ++k); // 131
printf("%d\n", sum += k++); // 176
printf("%d\n\n", sum += k++); // 222
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment