fork download
  1. using System;
  2. namespace OperatorsAppl
  3. {
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8. int a = 21;
  9. int c;
  10.  
  11. c = a;
  12. Console.WriteLine("= Value of c = {0}", c);
  13.  
  14. c += a;
  15. Console.WriteLine("+= Value of c = {0}", c);
  16.  
  17. c -= a;
  18. Console.WriteLine("-= Value of c = {0}", c);
  19.  
  20. c *= a;
  21. Console.WriteLine("*= Value of c = {0}", c);
  22.  
  23. c /= a;
  24. Console.WriteLine("/= Value of c = {0}", c);
  25.  
  26. c = 200;
  27. c %= a;
  28. Console.WriteLine("%= Value of c = {0}", c);
  29.  
  30.  
  31. c <<= 2;
  32. Console.WriteLine("<<= Value of c = {0}", c);
  33.  
  34. c >>= 2;
  35. Console.WriteLine(">>= Value of c = {0}", c);
  36.  
  37. c &= 2;
  38. Console.WriteLine("&= Value of c = {0}", c);
  39.  
  40. c ^= 2;
  41. Console.WriteLine("^= Value of c = {0}", c);
  42.  
  43. c |= 2;
  44. Console.WriteLine("|= Value of c = {0}", c);
  45. Console.ReadLine();
  46. }
  47. }
  48. }
Success #stdin #stdout 0.02s 14780KB
stdin
Standard input is empty
stdout
= Value of c = 21
+= Value of c = 42
-= Value of c = 21
*= Value of c = 441
/= Value of c = 21
%= Value of c = 11
<<= Value of c = 44
>>= Value of c = 11
&= Value of c = 2
^= Value of c = 0
|= Value of c = 2