C# Console Hello World Application in visual studio

C# Console Hello World Application in visual studio

Today, We want to share with you C# Console Hello World Application in visual studio.In this post we will show you C# console based application
, hear for Building a Hello World application with .NET Core and C# we will give you demo and example for implement.
In this post, we will learn about C# Hello World: First Console Application Program with an example.

What is console application

The console application is an type of application that runs in a console window same as a C++ and C program application.It does not posses any graphical or visual user interface. C# Console ApplicationConsole Applications works on character based interface.

READ :  Dynamically Added Meta Data,keywords,title using AngularJS

Console Application in C#

To read a line of text(input) from the console window that is entered by user, you can use the Console.ReadLine() method.It will read an input data from the console window and return the input string when user presses the Enter Key.

In C# Console Application, two methods are used extensively.

  1.  Console.Write() : This method writes the specified value to the console window screen
  2.  Console.WriteLine() : This method is very similar to above one except it adds a newline character at the end of the output.

Example: c# console application

The below lines of C#.NET code lets the user input a line of text and displays that text

READ :  AngularJS Nested ng-repeat with Grouping Lists

E-junkie: Sell digital downloads online

E-junkie Provides a Copy-paste buy-now, and cart buttons for selling downloads, codes and tangible products on any website, blog, social media, email and messenger!

Also see:

  1. The Top 10+ Best Webinar Software Platforms For 2020-2021
  2. Build Your Future Godaddy Careers And Jobs
  3. Introduction To Web Hosting Services

string _msg = Console.ReadLine();

C# Console Application Example

To write C# console program in visual studio,Open Visual Studio->File -> New Project ->Visual C#-> select Console Applications

using System;
namespace ProgramCall
    class Program
        static void Main(string[] args)
            int num1, num2, SUM;

            Console.WriteLine("Enter Two Integers"); 

            num1 = int.Parse(Console.ReadLine());

            num2 = int.Parse(Console.ReadLine()); 
            SUM = num1 + num2;
            Console.WriteLine("Sum  Of  {0}  And  {1}  Is  {2}", num1, num2, SUM);
            Console.Read();// To prevent console from disappear

C# Program Structure

using System;

namespace HelloWorldApplication {
   class HelloWorld {
      static void Main(string[] args) {
         /* Creating Hello World Program in C# */
         Console.WriteLine("Creating Hello World Program");

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

READ :  Angular Keep session alive Timeout management

I hope you get an idea about C# Hello World: First Console Application Program.I would like to have feedback on my Infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.