Friday 27 September 2013

Console Application in C#

How to create Console Application.

Overview

  • Creating Project
  • Edit
  • Compile
  • Debugging and Running
  • Pre-Processor
1. Create a new,empty C# project by selecting File/New/Project. Next, select Visual C# ,and then Console Application,as shown here:

Fig -1
Then ,change the name to Project 1 and press OK.

2.Once the project is created, the Visual Studio IDE will look like this:
Fig-2

3.Notice that a new window called Program.cs was created.This contains an empty template for a C# console program.This file is created automatically by Visual Studio 2008 and contains to C# program.
enter the program into the Program.cs window, and then save the file using the name Example.cs. When done, your screen will look like this:

Fig -3

4. Compile the program by selecting Build Solution from the Build menu.
5.Run the program by selecting Start without Debugging from the Debug menu .When you run the program,you will see the window show here.


Fig-4



0 comments:

Post a Comment