Skip to content

Instantly share code, notes, and snippets.

@morganwilde
Created November 6, 2013 19:11
Show Gist options
  • Save morganwilde/7342274 to your computer and use it in GitHub Desktop.
Save morganwilde/7342274 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
int inc = 0, dec = 0;
// incrementing a number
printf("inc = %d\n", inc);
inc++;
printf("inc (po inc++ operacijos) = %d\n", inc);
// decrementing a number
printf("dec = %d\n", dec);
dec--;
printf("dec (po dec-- operacijos) = %d\n", dec);
// rinse and repeat
inc++;
inc++;
inc++;
// inc is now equal to 4
inc--;
inc--;
// inc is now equal to 2
// ...
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment