Operators are symbols that performs certain task in an expression. Operators in C# are special symbols like + / == . ++ etc. These operators can be used to process data. There operators are categorized below:
C# Programming Tutorial
In any programing language including C#, constants are values which are fixed and cannot be changed anytime during program execution. They can be of any data type. We can use const to make a variable constant. Example of some constants are:
In any programing language including C#, variables are the memory space in computer where data can be stored. A variable in C# programming is defined by three main features: name, type and value (optional). Let us take an example:
int var = 1;
In above example, var is the name of variable, int is the type of variable var and 1 is the value stored in memory location.
Data type is a categorization of variable to define what type of data can be stored in that variable. In C#, declaration of a data type is compulsory. This helps compiler know what type of data will be stored in that variable.
These data types can be categorized in following three types:
In programming, keywords are reserved words for your compiler. Their meaning are already defined in compiler and are used for specific purpose only. These keywords cannot be used as identifiers(i.e, cannot be used for naming variables, classes etc.), however in C#, you can use keywords as variable or class name by using prefix "@".
Before we learn how to program in C#, we must first know about the sections of C# program. We must know every part of the program. This will help us know about code placement and it will be easier for us to write a program. So, let us look at a basic program in C# to understand different sections of C# program.