Created
May 9, 2012 21:03
-
-
Save Boztown/2648813 to your computer and use it in GitHub Desktop.
C#: Shorthand If
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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