C# Keywords and Identifiers

It is important that before programming you should know the C# Keywords and Identifiers. You need to know that keywords cannot be used as identifiers and more. C# Keywords There are some predefined and reserved words that have special meanings to the compiler. These words are called Keywords. The meaning of the keywords in C# … Read more

Type Casting in C#

C# allows us to convert the variables of one data type to another. This conversion referred to as type conversion or type casting. There are various ways to typecast variables, casting can be between a larger size type to a smaller size type or vice-versa. There are two types of casting in C#: Implicit Casting (automatic … Read more

C# Bitwise Operators

Bitwise operators are used to perform a bit-level operation on operands. They are used in testing, setting, or shifting the actual bits in a program. You can see the truth table below. p q p & q p | q p ^ q ~p 0 0 0 0 0 1 0 1 0 1 1 … Read more

C# Unary Operators (Increment and Decrement)

Unary Operators are the Increment and Decrement Operators. They operate on a single operand. They are ++ and — operators. ++ is used to increase the value by 1 and — is used to decrease the value by 1. Post-Increment or Post-Decrement:First, the value is used for operation and then incremented or decremented. Represented as … Read more

C# Logical Operators

Logical Operators are used to compute the logical operation in a program such as &&, || and !. They are used to evaluate the condition. The following are the C# Logical Operators. Assume X holds the value 1 and Y holds 0 Operator Description Example && (logical and) If both the operands are non-zero, then the … Read more

C# Relational Operators

Relational Operators are used in a program to check the relationship between two operands and accordingly, it returns boolean values, true or false. These operators are used with loops and Decision-Making Statements during condition checking. List of relational operators in C#: Operator Name Example == Equal to. A == B != Not equal. A != … Read more

C# Assignment Operators

These operators are used in a program to assign a value of the right-hand side to the left-hand side as shown below. You can combine write in short version such as instead of writing, int a = a+5, you can write it as a += 5. Following are the list of assignment operators used in C#. Operator … Read more

C# Arithmetic Operators

Arithmetic Operators are used to perform mathematical operations on operands such as addition, subtraction, multiplication, division etc. The following are the Arithmetic Operators operator description + additionadds two operands. eg, a+b. – subtractionsubtracts two operands. eg, a-b. * multiplicationmultiplies two operands. eg, a*b. / divisiondivides the operand by the second. eg, a/b. % moduloreturns the … Read more

C# Operators

Operators are the foundation of any programming language, the program is incomplete without the operators as we use them in all of our programs. Operators are the symbol that performs a specific mathematical or logical operation on operands.Example: Addition : 2 + 3, where 2 and 3 are the operands and + is the operator. … Read more

C# Program Structure

Before we begin further in this tutorial, it is important to know the basic building of C# programming. You need to have the basic knowledge on what C# program structure contain of. C# Program Structure Let us check the basic program written in C#. After execution of the above program, following output will be displayed. … Read more