C Sharp ARTICLE

History of C Sharp

Anders Hejlsberg image
Anders Hejlsberg

C Sharp programming language was designed by Anders Hejlsberg from Microsoft in 2000 and was later approved as an international standard by Ecma (ECMA-334) in 2002 and ISO/IEC (ISO/IEC 23270) in 2003. Microsoft introduced C Sharp along with .NET Framework and Visual Studio, both of which were closed-source.

C Sharp Introduction

What is C Sharp?

C Sharp Syntax

Example:

        
          using System;

          namespace HelloWorld
          {
            class Program
           {
             static void Main ( string[] args )
              {
                Console.WriteLine ( "Welcome to BUIE-Learning" ) ;
               }
            }
           }
        
      
        
          Result: Welcome to BUIE-Learning
        
      

C Sharp Variables

Example:

        
          int num = 5;
          double DoubleNum = 5.99D;
          char C = 'D';
          bool Bool = true;
          string myText = "Welcome";
         
    

Example of C sharp programming

Add Two Numbers

      
        static void Main(string[] args )
        {
            int num1, num2, sum;
            Console.WriteLine (" How to Calculate the sum of two numbers:");
            Console.WriteLine(" Input number 1: " );
            num1 = Convert.ToInt32(  Console.ReadLine());
            Console.Write(" Input number 2: " );
            num2 = Convert.ToInt32(Console.ReadLine() );
            sum = num1 + num2;
            Console.Write(" {0} + {1} = {2}",num1,num2,sum);

            Console.ReadKey();
        }
      
    
      
        Result: 
        How to Calculate the sum of two numbers:
        Input number 1: 5
        Input number 2: 10
        5 + 10 = 15