Append value together to output - CSharp Language Basics

CSharp examples for Language Basics:Console

Description

Append value together to output

Demo Code

using System;//from  w  ww  .j a  va2 s.co  m
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
   static void Main(string[] args)
   {
      // Data in variables
      string club1 = "FC Liverpool";
      string club2 = "Manchester United";
      int goals1 = 3;
      int goals2 = 2;
      // Output of match result
      Console.WriteLine("Match " + club1 + " - " + club2 +" ended with result " + goals1 + ":" + goals2 + ".");
   }
}

Result


Related Tutorials