Search This Blog

Wednesday, August 6, 2008

C# on Linux (mcs to compile and mono to execute the exe)

  • Write the following program in a Vi Editor and it save it in a file named HelloInteractive.cs.
using System; class InteractiveWelcome { public static void Main() { Console.Write("What is your name?: "); Console.Write("Hello, {0}! ", Console.ReadLine()); Console.WriteLine("Welcome to the C# Station Tutorial!"); Console.ReadLine(); } }
  • Compile the above program using mcs
  • Run the above program mono

No comments: