WriteLine and Write : Console : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Console »

 

WriteLine and Write








    
 


using System;

class ConsoleAdder {
    public static void Main() {
        int a = 15;
        int b = 744;
        int c = a + b;

        Console.Write("The sum of ");
        Console.Write(a);
        Console.Write(" and ");
        Console.Write(b);
        Console.Write(" equals ");
        Console.WriteLine(c);
        Console.WriteLine("The sum of " + a + " and " + b + " equals " + c);
        Console.WriteLine("The sum of {0} and {1} equals {2}", a, b, c);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Console