Skip to content

Instantly share code, notes, and snippets.

@dgw
Created October 18, 2011 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgw/1294363 to your computer and use it in GitHub Desktop.
Save dgw/1294363 to your computer and use it in GitHub Desktop.
Problem 3, Quiz 1, COSI 11A (Fall 2011), Brandeis University
/* ******************************** *\
* Package Name: Q1P3 *
* Description: The code from Quiz *
* 1, Problem 3 in the Fall 2011 *
* COSI 11A course at Brandeis. *
* Purpose: Demonstrating how the *
* given expressions really eval. *
\* ******************************** */
public class Q1P3 {
public static void main(String[] args) {
int a = 5;
int b = 10;
int c = b;
a = a++;
b = --b;
c += a - (c--);
// The moment of truth
System.out.printf("a = %d\nb = %d\nc = %d\n", a, b, c);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment