The best way to
learn a new language like C# is to write a few simple programs and
execute them.This will enable us to analyze and understand how C#
programs work.
We begin with a very simple program that displays a line of text.
class Sampleone
{
public static void Main( )
{
System.Console.WriteLine("C# is sharper than C++);
}
}
This is the simplest program of all C# programs.
C# is a freefrom language.We need not indent any lines to make the program work property.
C# does not care where on the line we begin coding.While this may be a
license for bad programming.We should try to use this fact to our
advantage for designing readable programs.Although several alternative
styles are possible,we should select one and try to use it consistently.
For example,the statement
System.Console.WriteLine("Hello");
("hello!");
or even as
System.Console.WriteLine
{
"Hello!"
}