Advertisement
Guest User

Untitled

a guest
Aug 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. //int y (1 or 2)
  2. int x = 1;
  3. if(y == 2) x = 2;
  4.  
  5. //bool y (true or false)
  6. bool x = true;
  7. if(y) x = false;
  8.  
  9. int x = (y == 2 ? 2 : 1);
  10.  
  11. bool x = (y ? false : true);
  12.  
  13. bool x = !y;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement