Search This Blog

Saturday, 7 September 2013

Print "Hello World" in C#

Basic program of C# to print "hello world"

using System;  // importing namespace(package)

public class MyClass
{
   public static void Main(String[] args)
   {
       Console.WriteLine("Hello World");
       Console.ReadLine();
   }
}

// Console is a class and WriteLine is a Static Method of Console Class

Steps to RUN C# program:
1...Open Command Prompt and set the File Location
2...Compile the c# code by csc <file_name>.cs
3...After Compling the code if Code free from errors
then  write  <file_name>

Running Program as :
Output



No comments:

Popular Posts