Skip to content

Instantly share code, notes, and snippets.

@Boztown
Created May 9, 2012 21:03
Show Gist options
  • Save Boztown/2648813 to your computer and use it in GitHub Desktop.
Save Boztown/2648813 to your computer and use it in GitHub Desktop.
C#: Shorthand If
// Using the (Question) ? Positive Answer : Negative Answer patterns the above can be rewritten as:
int x = 10;
int y = 20;
int max = (x > y) ? x : y;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment