Subscribe

RSS Feed (xml)

A First Simple Program

It is now time to look at an actual C# program. We will begin by compiling and running the short program shown here:


/*

This is a simple C# program.
Call this program Example.cs.

*/

using System;

class Example {

// A C# program begins with a call to Main().

public static void Main() {

Console.WriteLine("A simple C# program.");

}

}

The primary development environment for C# is Microsoft’s Visual Studio. To compile all of the programs in this book, including those that use the new C# 2.0 features, you will need to use Visual Studio 2005, or later. Using Visual Studio 2005, there are two ways to edit, compile, and run a C# program.

1.Using the command-line compiler, csc.exe.
2.Using the Visual Studio Integrated Development Environment (IDE).

No comments:

Post a Comment

LocalsAdda.com-Variety In Web World

Fun Mail - Fun in the Mail