Start with Console Application C#

Today, in this asp.net tutorial we will learn what is console application and how to create and run console application in visual studio 2010 with c# language.

The Console application is a application that run in a console output windows like c and c++ program. The Console application dose not have graphical user interface.

The Console application takes input and gives output at on command line output.

We can create console application in visual studio. Here we will learn to create console application in visual studio 2010 with c# language.

Open Visual Studio 2010 –> File –>> New Project –>> Console Application

In Visual studio create console application, we have to use Console class which is available with System namespace. System is the root namespace of console application.

Before, create console application we need to get basic ideas about Console.ReadLine(), Console.Write() and Console.WriteLine() Methods.

Console.ReadLine() – This method is used to read a string text from console windows. This will read input text from user at console windows and displays string at console windows when user press the enter key.

Console.Write() - write the text at console windows in same line.

Console.WriteLine() – Write the text at console windows and add a new line character at the end of the line.

Create Console application example in asp.net c#

Create Console application in visual studio C# .net

Create Console application in visual studio C# .net

In above visual studio home screen select file –> New Project option.

Select Console Application from dialog box and select Visual C# language and Give your first application name shows like below screen.

Create Console application in visual studio C# .net

Create New Console application in visual studio C# .net

After creating console application below is the first screen of console application.

Create Console application in visual studio C# .net

Create Console application in visual studio C# .net

Here, we have created one example for sum of two integer digit in console application. In this example we will input two integer values and get sum of that inputted values as output.

The c# code of  sum example.

 

Create Console application in visual studio C# .net

Create Console application in visual studio C# .net

Here is out put  of console application example for sum of two integer  values.

Output of console application in c#. net

Output of console application in c#. net

I hope you will understand how to create console application in visual studio.

Download Console Application Example ASP.Net
asp.net example

Leave a Reply

Your email address will not be published. Required fields are marked *

2 + 4 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">