Programming Course in C# ¡Free!

Formats and lines

 Monday, November 05, 2012 published by Exercises C#
Course > Basic concepts > Formats and lines
Create a program in C# to print Hello on screen and then print your name in a separate line. Do it in three ways: ✔ Using only Console.Write. ✔ Using only Console.WriteLine. ✔ Using parameters witch Console.WriteLine or Console.Write.




Hello Jonny!
Hello Jonny!
Hello Jonny!
using System;
public class Exercise
    public static void Main( )
         // using only Console.Write
         // using only Console.WriteLine 
         // using parameters         
         Console.Write("{0}", "Hello\nJonny!");