C-Sharp Hello World: First Program In Visual Studio

Hello friends, I will explain to run first console application program in microsoft visual studio step-by-step.

 

To create and run first console application in C#

Open Visual Studio.

From menu bar (Or Press Alt+F), Navigate to File/New/Project (OR Press CTRL+Shift+N)

From Project dialog box, Expand Installed, Click Visual C#, and then choose Console App (.net Freamework) from right panel.

In the Name box, specify a name for your project, location and Solution Name, then click on OK button.

The new project appears in Solution Explorer (Ctrl+Alt+l).

A Program.cs file will open in the Code Editor, if not find it under Solution Explorer and double click to open it.

 

Replace the contents of Program.cs with the following code.

using System; /// /// My First Hello Word Program In C# /// namespace SWClass { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); Console.WriteLine("Press any key to exit."); // To stay for result output Console.ReadKey(); } } }

Press the F5 key to run the project. A Command Prompt window appears that contains the line

Output:

Hello World!

If you have any query or question or topic on which, we might have to write an article for your interest or any kind of suggestion regarding this post, Just feel free to write us, by hit add comment button below or contact via Contact Us form.


Your feedback and suggestions will be highly appreciated. Also try to leave comments from your valid verified email account, so that we can respond you quickly.

 
 

{{c.Content}}

Comment By: {{c.Author}}  On:   {{c.CreatedDate|date:'dd/MM/yyyy'}} / Reply


Categories