Guest User

Untitled

a guest
Jan 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. num = forward.Data.Key >= key ? 1 : 0;
  2.  
  3. if( forward.Data.Key >= key ) {
  4. num = 1;
  5. }
  6. else {
  7. num = 0;
  8. }
  9.  
  10. value = condition ? truePart : falsePart;
  11.  
  12. int input = Convert.ToInt32(Console.ReadLine());
  13. string classify;
  14.  
  15. // if-else construction.
  16. if (input < 0)
  17. classify = "negative";
  18. else
  19. classify = "positive";
  20.  
  21. // ?: conditional operator.
  22. classify = (input < 0) ? "negative" : "positive";
Add Comment
Please, Sign In to add comment