Advertisement
mjc65

Example 1-60. The conditional operator

Jun 23rd, 2020
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.12 KB | None | 0 0
  1. private static int GetValue(bool p)
  2. {
  3.     if (p)
  4.         return 1;
  5.     else
  6.         return 0;
  7.  
  8.     return p ? 1 : 0;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement