fork download
  1. //****************************************************************
  2. // Addition.cs C#: Ken Culp
  3. //
  4. // Demonstrates the difference between the addition and string
  5. // concatenation operators.
  6. //****************************************************************
  7. using System;
  8.  
  9. namespace Addition
  10. {
  11. class Addition
  12. {
  13. static void Main(string[] args)
  14. {
  15. Console.Out.WriteLine("24 and 45 concatenated: " + 24 +45);
  16. Console.Out.WriteLine("24 and 25 added: " + (24 + 45));
  17. Console.In.ReadLine();
  18. }
  19. }
  20. }
Success #stdin #stdout 0.03s 37016KB
stdin
Standard input is empty
stdout
24 and 45 concatenated: 2445
24 and 25 added: 69