Introduction To C# with an Example



Introduction to c#

C#  is a high level language and its first version C# 1.0  released by Microsoft in 13th February 2002. Syntax is almost similar to C++.

what is c#?

  • C# is an Object Oriented Programming Language Developed By Microsoft.
  • C# is a high level Language as this does not depend upon the hardware directly.
  • Users having good knowledge into C++ can use it as syntax is almost similar to C# .
Why C#?

Below are the reason why C# is more popular.

  • Easy to Start- As C# syntax is similar to C,C++ and Java , Developer can easily migrate to this language and learn with no time.
  • Widely used in Desktop and Web Application-As C# is more popular because of easy syntax and reach library, this is used widely now a days
  • Larger Community-C# has larger community and hence more IDE to develop program.
  • Game Development- C# is more popular in Game development because of reach libraries and easy to develop.

c# compare version numbers                                                           

Version number CLR version Release date
1.0 1.0 2002-02-13
1.1 1.1 2003-04-24
2.0 2.0 2005-11-07
3.0 2.0 2006-11-06
3.5 2.0 2007-11-19
4.0 4 2010-04-12
4.5 4 2012-08-15
4.5.1 4 2013-10-17
4.5.2 4 2014-05-05
4.6 4 2015-07-20
4.6.1 4 2015-11-17
4.6.2 4 2016-08-02
4.7 4 2017-04-05
4.7.1 4 2017-10-17



Lets Understand with a program.


Open/Lunch Visual Studio-> Go to File->New->Project
New Project Pop up will Appear.
Under Templates Select Visual C# and select the template 
called Console App as below.

visual studio application templates
visual studio application templates


Enter Project Name and Solution name of your Choice.
Set the location for your project and Click OK as below.


project and solution visual studio
project and solution visual studio



A new project will be created based upon the Project name and the solution name.

Lets Write a simple program under above created Project.


using System;

namespace ConsoleApp1
{
    class SampleProgram
    {
        //Read Technotech
        //Print Welcome to Technotech
        static void Main(string[] args)
        {
            String string1 = string.Empty;
            Console.WriteLine("Enter a String....");
            string1 = Console.ReadLine();
            Console.WriteLine("Welcome to " + string1);
            Console.ReadKey();
        }
    }
}

Press F5 or Ctrl + F5 to run the application.


console output c#
console output c#

In the above Image I enter "Technotech"

We got the output "Welcome to Technotech"


Thanks..........




Share:

No comments:

Post a Comment

Contact for Azure Training

Name

Email *

Message *

Subscribe YouTube

Total Pageviews

Popular Posts

Labels

Recent Posts