Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. /* Assignment Operators
  2.  
  3. Here, x = 10 and y = 5;
  4.  
  5. = x = y
  6. > x = 5
  7.  
  8. += x += y OR x = x + y
  9. > x = 15
  10.  
  11. -= x -= y OR x = x - y
  12. > x = 5
  13.  
  14. *= x *= y OR x = x * y
  15. > 50
  16.  
  17. /= x /= y OR x = x / y
  18. > 2
  19.  
  20. %= x %=y OR x = x % y
  21. > 0
  22.  
  23. */
  24.  
  25. // Assign value to a
  26. a = value;
  27. // Assign value to b if b is null;
  28. // otherwise, b stays the same
  29. b ??= value;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement