Skip to content

Instantly share code, notes, and snippets.

@CarlSmotricz
Created September 9, 2015 19:19
Show Gist options
  • Save CarlSmotricz/1cc4ff3adb5cba973c61 to your computer and use it in GitHub Desktop.
Save CarlSmotricz/1cc4ff3adb5cba973c61 to your computer and use it in GitHub Desktop.
A simple Java program demonstrating math with integers.
class Ideone
{
public static void main (String[] args)
{
int A, B, C, D;
A = 1; B = 2; C = 3; D = 4;
if (A + C == D) D = D - 2;
if (2 * D + 4 * A < 10) A = A + 4;
if (A + D > 3 * B + C) B = C - A;
if (B < C) C = B;
System.out.println(A + B + C + D);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment