...

/

Structure of a C# Program

Structure of a C# Program

Learn about how C# programs are structured.

Statements and code blocks

C# code files are text files with .cs extension. They contain instructions that’re compiled to ILIntermediate Language code.

Statements are the basic building blocks of C# source code. A statement can be some action, such as an arithmetic operation, a method invocation, or a variable declaration and assignment.

Console.WriteLine("This is a statement.");

Like in C and C++, every statement must be followed by a semicolon (;). Leaving them out results in compilation errors, and our ...