Skip to main content

C# Basic

C# is a general purpose modern object oriented programming language with multiple paradigms. It was designed for Common Language Infrastructure (CLI) in 2000 by Microsoft for its .NET framework. In other words it contains classes, objects, interfaces and inheritance.
Visual Studio .NET includes enormous enhancements over its predecessor Visual Studio ranging from a completely refurbished Visual Basic.NET(VB.NET) to the introduction of a new language Visual C#.NET.

C#(C-Sharp) is a new language which is derived from C and C++. Some of the features include:
- It is simpler as No Pointers. Unsafe operations are not allowed. No usage of “::” or “->” operators.
- “==“ is used for comparison, while”=” is used for assignments.
- Web Service Support – Turn any component into a web service
- Interoperable, Utilises all the benefits of the CLR. Support for COM.
- Objected Orientated – Supports Data encapsulation, inheritance, polymorphism and interfaces.
- Type Safe – Unsafe typecasts are not allowed. Primitive types are initialised to zeros and objects are initialised to null automatically.

First C# program
Type the following into a text editor (e.g. notepad), and save it with a .cs extension. (e.g. firstprogram.cs);
using System;
namespace MyNamespace
{
  class MyCsharpClass
{
  static void Main()
 {
   Console.WriteLine ("This is my first C# Program!");
   Console.ReadLine();
  }
}
}

You can compile above program by simply running the C# command line compiler(i.e. CSC.Exe)
CSC First.cs
Then you can execute the firstprogram.exe by typing firstprogram at the command prompt

Comments

Popular posts from this blog

The 120 year old light bulb that never been turned off.

Light bulb that never been turned off since 1901. ivermore's Centennial Light Bulb The Centennial Light is the world's longest-lasting light bulb, burning since 1901 , and almost never switched off. Due to its longevity, the bulb has been noted by The Guinness Book of World Records , Ripley's Believe It or Not!, and General Electric.  The Centennial Light was originally a 30-watt(or 60-watt) bulb, but is now very dim, emitting about the same light as a 4-watt nightlight. The hand-blown, carbon-filament common light bulb was manufactured in Shelby, Ohio, by the Shelby Electric Company in the late 1890s and was invented by Adolphe A. Chaillet. The hand-blown, carbon-filament common light bulb was invented by Adolphe Chaillet, a French engineer who filed a patent for this technology. It was manufactured in Shelby, Ohio, by the Shelby Electric Company in the late 1890s; many just like it still exist and can be found functioning. According to Zylpha Bernal Beck, the bulb was...

Robot

Robot is drawn from an old Church Slavonic word, robota, for “servitude,” “forced labor” or “drudgery.” The word, which also has cognates in German, Russian, Polish and Czech, was a product of the central European system of serfdom by which a tenant’s rent was paid for in forced labor or service. The word robot was coined by artist Josef Čapek, the brother of famed Czechoslovakian author Karel Čapek. As a word, robot is a relative newcomer to the English language. It was the brainchild of a brilliant Czech playwright, novelist and journalist named Karel Čapek (1880-1938) who introduced it in his 1920 hit play, R.U.R., or Rossum’s Universal Robots. The robots in this play were not what we would call robots today, and they weren’t made of steel, plastic, and lines of code. Those robots were manufactured as pseudo-organic components out of a substance that acted like protoplasm in a factory, then “assembled” into humanoids. Watch video --> Saudi Arabia grants citizenship to huma...

Cloud computing

Cloud computing Cloud computing is on-demand access, via the internet, to computing resources—applications, servers (physical servers and virtual servers), data storage, development tools, networking capabilities, and more—hosted at a remote data center managed by a cloud services provider (or CSP). The CSP makes these resources available for a monthly subscription fee or bills them according to usage. Simply put, cloud computing is the delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence—over the Internet (“the cloud”) to offer faster innovation, flexible resources, and economies of scale. You typically pay only for cloud services you use, helping you lower your operating costs, run your infrastructure more efficiently, and scale as your business needs change. Cloud computing is a big shift from the traditional way businesses think about IT resources. Cloud computing has been credited with increasing competitivenes...