Array is a collection of variables of fixed size stored in a continuous memory location. They are also known as elements. These elements are accessed by its index. The elements in an array are numbered from 0 to n-1 (n being the length of array), those numbers are called indices.
C# Programming Tutorial
A method is a block of codes that contains some statements and perform particular task. Using method increases the quality of our program a lot. Some of them are listed below:
Encapsulation is the process of collecting functions and data in one unit called class. Encapsulation is also known as process of hiding data in object oriented programming languages. Encapsulation allows specify access level of a class or its members. This protects data from being corrupted and codes will be less complex, maintainable and flexible.
Loop can be used inside loop in any programming language including C#. Such loops are known as nested loops.
For Loop is a loop in programming languages like C# that repeats a block of statements until a condition provided is satisfied. Unlike other less structured loops like while and do..while, this loop contains initialization, condition and increment/decrement before the loop statement.
Do While Loop is just like any other loop in C#, but in this loop we have condition at the end of the loop. So this guarantees the execution of statements inside the loop at least once and the loop will be repeated if the condition is satisfied until the condition is false. The condition can be changed in the loop statements. We can also exit the loop using break statement.
While Loop is a loop in programming languages like C# that repeats a block of statements until a given condition is true. The condition comes after while and it can be any expression that return boolean value. The expression inside the while loop is executed only if the condition is satisfied. The condition can be changed inside the loop. The loop exits when the condition is false.
switch case is a conditional statement where a switch statement compares a variable with a number of provided values called cases and executes a block of statements for each case.
if statement is conditional or decision making statement. It uses boolean variable or a condition which gives a boolean result and a statement or block of statements which will be executed only if the condition is satisfied or boolean result is true.
Operator Precedence is ordering of operators according of its priority. Each operator have different priority level. For example, in a expression a = b + c / d; , operator '/' has the highest precedence and operator '=' has the lowest precedence. So, '/' will be operated first, '+' will be operated after that and lastly '=' will be operated.